Changes in / [aee7e35:7b69174]
- Files:
-
- 8 deleted
- 39 edited
-
doc/aaron_comp_II/Efficient Type Resolution in Cforall.pptx (deleted)
-
doc/aaron_comp_II/conversion_dag.png (deleted)
-
doc/aaron_comp_II/resolution_dag.png (deleted)
-
doc/aaron_comp_II/resolution_dag2.odg (deleted)
-
doc/aaron_comp_II/resolution_dag2.png (deleted)
-
src/CodeGen/GenType.cc (modified) (2 diffs)
-
src/Common/DebugMalloc.cc (deleted)
-
src/Common/SemanticError.h (modified) (2 diffs)
-
src/Common/module.mk (modified) (1 diff)
-
src/Common/utility.h (modified) (5 diffs)
-
src/Makefile.am (modified) (2 diffs)
-
src/Makefile.in (modified) (13 diffs)
-
src/Parser/DeclarationNode.cc (modified) (62 diffs)
-
src/Parser/ExpressionNode.cc (modified) (2 diffs)
-
src/Parser/ParseNode.h (modified) (15 diffs)
-
src/Parser/TypeData.cc (modified) (33 diffs)
-
src/Parser/TypeData.h (modified) (6 diffs)
-
src/Parser/parser.cc (modified) (552 diffs)
-
src/Parser/parser.h (modified) (1 diff)
-
src/Parser/parser.yy (modified) (15 diffs)
-
src/ResolvExpr/AdjustExprType.cc (modified) (2 diffs)
-
src/ResolvExpr/CommonType.cc (modified) (5 diffs)
-
src/ResolvExpr/ConversionCost.cc (modified) (3 diffs)
-
src/ResolvExpr/ConversionCost.h (modified) (1 diff)
-
src/ResolvExpr/PtrsAssignable.cc (modified) (2 diffs)
-
src/ResolvExpr/PtrsCastable.cc (modified) (2 diffs)
-
src/ResolvExpr/RenameVars.cc (modified) (1 diff)
-
src/ResolvExpr/RenameVars.h (modified) (1 diff)
-
src/ResolvExpr/Resolver.cc (modified) (2 diffs)
-
src/ResolvExpr/Unify.cc (modified) (2 diffs)
-
src/SymTab/FixFunction.cc (modified) (1 diff)
-
src/SymTab/FixFunction.h (modified) (1 diff)
-
src/SymTab/ImplementationType.cc (modified) (2 diffs)
-
src/SymTab/Mangler.cc (modified) (1 diff)
-
src/SymTab/Mangler.h (modified) (1 diff)
-
src/SymTab/TypeEquality.cc (modified) (2 diffs)
-
src/SynTree/Mutator.cc (modified) (1 diff)
-
src/SynTree/Mutator.h (modified) (1 diff)
-
src/SynTree/SynTree.h (modified) (1 diff)
-
src/SynTree/Type.h (modified) (1 diff)
-
src/SynTree/TypeSubstitution.cc (modified) (2 diffs)
-
src/SynTree/TypeSubstitution.h (modified) (1 diff)
-
src/SynTree/Visitor.cc (modified) (1 diff)
-
src/SynTree/Visitor.h (modified) (1 diff)
-
src/SynTree/ZeroOneType.cc (deleted)
-
src/SynTree/module.mk (modified) (1 diff)
-
src/libcfa/memcheck.awk (deleted)
Legend:
- Unmodified
- Added
- Removed
-
src/CodeGen/GenType.cc
raee7e35 r7b69174 42 42 virtual void visit( TypeInstType *typeInst ); 43 43 virtual void visit( VarArgsType *varArgsType ); 44 virtual void visit( ZeroType *zeroType );45 virtual void visit( OneType *oneType );46 44 47 45 private: … … 202 200 } 203 201 204 void GenType::visit( ZeroType *zeroType ) {205 // ideally these wouldn't hit codegen at all, but should be safe to make them ints206 typeString = "int " + typeString;207 handleQualifiers( zeroType );208 }209 210 void GenType::visit( OneType *oneType ) {211 // ideally these wouldn't hit codegen at all, but should be safe to make them ints212 typeString = "int " + typeString;213 handleQualifiers( oneType );214 }215 216 202 void GenType::handleQualifiers( Type *type ) { 217 203 if ( type->get_isConst() ) { -
src/Common/SemanticError.h
raee7e35 r7b69174 10 10 // Created On : Mon May 18 07:44:20 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Sat Sep 24 15:13:42 201613 // Update Count : 512 // Last Modified On : Mon Jun 8 14:38:53 2015 13 // Update Count : 4 14 14 // 15 15 … … 46 46 } 47 47 48 48 49 #endif // SEMANTICERROR_H 49 50 -
src/Common/module.mk
raee7e35 r7b69174 11 11 ## Created On : Mon Jun 1 17:49:17 2015 12 12 ## Last Modified By : Peter A. Buhr 13 ## Last Modified On : T ue Sep 27 11:06:38201614 ## Update Count : 413 ## Last Modified On : Thu Aug 18 13:29:04 2016 14 ## Update Count : 2 15 15 ############################################################################### 16 16 17 17 SRC += Common/SemanticError.cc \ 18 18 Common/UniqueName.cc \ 19 Common/DebugMalloc.cc \20 19 Common/Assert.cc -
src/Common/utility.h
raee7e35 r7b69174 10 10 // Created On : Mon May 18 07:44:20 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Fri Sep 23 11:46:47201613 // Update Count : 2 812 // Last Modified On : Wed Jun 8 17:33:59 2016 13 // Update Count : 22 14 14 // 15 15 … … 25 25 #include <sstream> 26 26 #include <string> 27 #include <cassert>28 27 29 28 template< typename T > … … 102 101 } // if 103 102 } // for 103 } 104 105 static inline std::string assign_strptr( const std::string *str ) { 106 if ( str == 0 ) { 107 return ""; 108 } else { 109 std::string tmp; 110 tmp = *str; 111 delete str; 112 return tmp; 113 } // if 104 114 } 105 115 … … 131 141 132 142 template < typename T > 133 void toString_single ( std::ostream & os, const T & value ) {143 void toString_single ( std::ostream & os, const T & value ) { 134 144 os << value; 135 145 } 136 146 137 147 template < typename T, typename... Params > 138 void toString_single ( std::ostream & os, const T & value, const Params & ... params ) {148 void toString_single ( std::ostream & os, const T & value, const Params & ... params ) { 139 149 os << value; 140 150 toString_single( os, params ... ); … … 142 152 143 153 template < typename ... Params > 144 std::string toString ( const Params & ... params ) {154 std::string toString ( const Params & ... params ) { 145 155 std::ostringstream os; 146 156 toString_single( os, params... ); -
src/Makefile.am
raee7e35 r7b69174 11 11 ## Created On : Sun May 31 08:51:46 2015 12 12 ## Last Modified By : Peter A. Buhr 13 ## Last Modified On : Sat Sep 24 15:03:52 201614 ## Update Count : 7 313 ## Last Modified On : Sat Aug 20 11:13:12 2016 14 ## Update Count : 71 15 15 ############################################################################### 16 16 … … 40 40 cfa_cpplib_PROGRAMS = driver/cfa-cpp 41 41 driver_cfa_cpp_SOURCES = ${SRC} 42 driver_cfa_cpp_LDADD = ${LEXLIB} -ldl# yywrap42 driver_cfa_cpp_LDADD = ${LEXLIB} # yywrap 43 43 driver_cfa_cpp_CXXFLAGS = -Wno-deprecated -Wall -DDEBUG_ALL -rdynamic -I${abs_top_srcdir}/src/include 44 44 -
src/Makefile.in
raee7e35 r7b69174 98 98 Common/driver_cfa_cpp-SemanticError.$(OBJEXT) \ 99 99 Common/driver_cfa_cpp-UniqueName.$(OBJEXT) \ 100 Common/driver_cfa_cpp-DebugMalloc.$(OBJEXT) \101 100 Common/driver_cfa_cpp-Assert.$(OBJEXT) \ 102 101 ControlStruct/driver_cfa_cpp-LabelGenerator.$(OBJEXT) \ … … 166 165 SynTree/driver_cfa_cpp-AttrType.$(OBJEXT) \ 167 166 SynTree/driver_cfa_cpp-VarArgsType.$(OBJEXT) \ 168 SynTree/driver_cfa_cpp-ZeroOneType.$(OBJEXT) \169 167 SynTree/driver_cfa_cpp-Constant.$(OBJEXT) \ 170 168 SynTree/driver_cfa_cpp-Expression.$(OBJEXT) \ … … 360 358 CodeGen/CodeGenerator.cc CodeGen/GenType.cc \ 361 359 CodeGen/FixNames.cc CodeGen/OperatorTable.cc \ 362 Common/SemanticError.cc Common/UniqueName.cc \ 363 Common/DebugMalloc.cc Common/Assert.cc \ 360 Common/SemanticError.cc Common/UniqueName.cc Common/Assert.cc \ 364 361 ControlStruct/LabelGenerator.cc ControlStruct/LabelFixer.cc \ 365 362 ControlStruct/MLEMutator.cc ControlStruct/Mutate.cc \ … … 393 390 SynTree/ReferenceToType.cc SynTree/TupleType.cc \ 394 391 SynTree/TypeofType.cc SynTree/AttrType.cc \ 395 SynTree/VarArgsType.cc SynTree/ ZeroOneType.cc \396 SynTree/ Constant.cc SynTree/Expression.cc SynTree/TupleExpr.cc \392 SynTree/VarArgsType.cc SynTree/Constant.cc \ 393 SynTree/Expression.cc SynTree/TupleExpr.cc \ 397 394 SynTree/CommaExpr.cc SynTree/TypeExpr.cc \ 398 395 SynTree/ApplicationExpr.cc SynTree/AddressExpr.cc \ … … 416 413 cfa_cpplibdir = ${libdir} 417 414 driver_cfa_cpp_SOURCES = ${SRC} 418 driver_cfa_cpp_LDADD = ${LEXLIB} -ldl# yywrap415 driver_cfa_cpp_LDADD = ${LEXLIB} # yywrap 419 416 driver_cfa_cpp_CXXFLAGS = -Wno-deprecated -Wall -DDEBUG_ALL -rdynamic -I${abs_top_srcdir}/src/include 420 417 all: $(BUILT_SOURCES) … … 516 513 Common/$(DEPDIR)/$(am__dirstamp) 517 514 Common/driver_cfa_cpp-UniqueName.$(OBJEXT): Common/$(am__dirstamp) \ 518 Common/$(DEPDIR)/$(am__dirstamp)519 Common/driver_cfa_cpp-DebugMalloc.$(OBJEXT): Common/$(am__dirstamp) \520 515 Common/$(DEPDIR)/$(am__dirstamp) 521 516 Common/driver_cfa_cpp-Assert.$(OBJEXT): Common/$(am__dirstamp) \ … … 720 715 SynTree/driver_cfa_cpp-VarArgsType.$(OBJEXT): SynTree/$(am__dirstamp) \ 721 716 SynTree/$(DEPDIR)/$(am__dirstamp) 722 SynTree/driver_cfa_cpp-ZeroOneType.$(OBJEXT): SynTree/$(am__dirstamp) \723 SynTree/$(DEPDIR)/$(am__dirstamp)724 717 SynTree/driver_cfa_cpp-Constant.$(OBJEXT): SynTree/$(am__dirstamp) \ 725 718 SynTree/$(DEPDIR)/$(am__dirstamp) … … 793 786 -rm -f CodeGen/driver_cfa_cpp-OperatorTable.$(OBJEXT) 794 787 -rm -f Common/driver_cfa_cpp-Assert.$(OBJEXT) 795 -rm -f Common/driver_cfa_cpp-DebugMalloc.$(OBJEXT)796 788 -rm -f Common/driver_cfa_cpp-SemanticError.$(OBJEXT) 797 789 -rm -f Common/driver_cfa_cpp-UniqueName.$(OBJEXT) … … 885 877 -rm -f SynTree/driver_cfa_cpp-Visitor.$(OBJEXT) 886 878 -rm -f SynTree/driver_cfa_cpp-VoidType.$(OBJEXT) 887 -rm -f SynTree/driver_cfa_cpp-ZeroOneType.$(OBJEXT)888 879 -rm -f Tuples/driver_cfa_cpp-NameMatcher.$(OBJEXT) 889 880 -rm -f Tuples/driver_cfa_cpp-TupleAssignment.$(OBJEXT) … … 900 891 @AMDEP_TRUE@@am__include@ @am__quote@CodeGen/$(DEPDIR)/driver_cfa_cpp-OperatorTable.Po@am__quote@ 901 892 @AMDEP_TRUE@@am__include@ @am__quote@Common/$(DEPDIR)/driver_cfa_cpp-Assert.Po@am__quote@ 902 @AMDEP_TRUE@@am__include@ @am__quote@Common/$(DEPDIR)/driver_cfa_cpp-DebugMalloc.Po@am__quote@903 893 @AMDEP_TRUE@@am__include@ @am__quote@Common/$(DEPDIR)/driver_cfa_cpp-SemanticError.Po@am__quote@ 904 894 @AMDEP_TRUE@@am__include@ @am__quote@Common/$(DEPDIR)/driver_cfa_cpp-UniqueName.Po@am__quote@ … … 992 982 @AMDEP_TRUE@@am__include@ @am__quote@SynTree/$(DEPDIR)/driver_cfa_cpp-Visitor.Po@am__quote@ 993 983 @AMDEP_TRUE@@am__include@ @am__quote@SynTree/$(DEPDIR)/driver_cfa_cpp-VoidType.Po@am__quote@ 994 @AMDEP_TRUE@@am__include@ @am__quote@SynTree/$(DEPDIR)/driver_cfa_cpp-ZeroOneType.Po@am__quote@995 984 @AMDEP_TRUE@@am__include@ @am__quote@Tuples/$(DEPDIR)/driver_cfa_cpp-NameMatcher.Po@am__quote@ 996 985 @AMDEP_TRUE@@am__include@ @am__quote@Tuples/$(DEPDIR)/driver_cfa_cpp-TupleAssignment.Po@am__quote@ … … 1138 1127 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o Common/driver_cfa_cpp-UniqueName.obj `if test -f 'Common/UniqueName.cc'; then $(CYGPATH_W) 'Common/UniqueName.cc'; else $(CYGPATH_W) '$(srcdir)/Common/UniqueName.cc'; fi` 1139 1128 1140 Common/driver_cfa_cpp-DebugMalloc.o: Common/DebugMalloc.cc1141 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT Common/driver_cfa_cpp-DebugMalloc.o -MD -MP -MF Common/$(DEPDIR)/driver_cfa_cpp-DebugMalloc.Tpo -c -o Common/driver_cfa_cpp-DebugMalloc.o `test -f 'Common/DebugMalloc.cc' || echo '$(srcdir)/'`Common/DebugMalloc.cc1142 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) Common/$(DEPDIR)/driver_cfa_cpp-DebugMalloc.Tpo Common/$(DEPDIR)/driver_cfa_cpp-DebugMalloc.Po1143 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='Common/DebugMalloc.cc' object='Common/driver_cfa_cpp-DebugMalloc.o' libtool=no @AMDEPBACKSLASH@1144 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@1145 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o Common/driver_cfa_cpp-DebugMalloc.o `test -f 'Common/DebugMalloc.cc' || echo '$(srcdir)/'`Common/DebugMalloc.cc1146 1147 Common/driver_cfa_cpp-DebugMalloc.obj: Common/DebugMalloc.cc1148 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT Common/driver_cfa_cpp-DebugMalloc.obj -MD -MP -MF Common/$(DEPDIR)/driver_cfa_cpp-DebugMalloc.Tpo -c -o Common/driver_cfa_cpp-DebugMalloc.obj `if test -f 'Common/DebugMalloc.cc'; then $(CYGPATH_W) 'Common/DebugMalloc.cc'; else $(CYGPATH_W) '$(srcdir)/Common/DebugMalloc.cc'; fi`1149 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) Common/$(DEPDIR)/driver_cfa_cpp-DebugMalloc.Tpo Common/$(DEPDIR)/driver_cfa_cpp-DebugMalloc.Po1150 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='Common/DebugMalloc.cc' object='Common/driver_cfa_cpp-DebugMalloc.obj' libtool=no @AMDEPBACKSLASH@1151 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@1152 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o Common/driver_cfa_cpp-DebugMalloc.obj `if test -f 'Common/DebugMalloc.cc'; then $(CYGPATH_W) 'Common/DebugMalloc.cc'; else $(CYGPATH_W) '$(srcdir)/Common/DebugMalloc.cc'; fi`1153 1154 1129 Common/driver_cfa_cpp-Assert.o: Common/Assert.cc 1155 1130 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT Common/driver_cfa_cpp-Assert.o -MD -MP -MF Common/$(DEPDIR)/driver_cfa_cpp-Assert.Tpo -c -o Common/driver_cfa_cpp-Assert.o `test -f 'Common/Assert.cc' || echo '$(srcdir)/'`Common/Assert.cc … … 2089 2064 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 2090 2065 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o SynTree/driver_cfa_cpp-VarArgsType.obj `if test -f 'SynTree/VarArgsType.cc'; then $(CYGPATH_W) 'SynTree/VarArgsType.cc'; else $(CYGPATH_W) '$(srcdir)/SynTree/VarArgsType.cc'; fi` 2091 2092 SynTree/driver_cfa_cpp-ZeroOneType.o: SynTree/ZeroOneType.cc2093 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT SynTree/driver_cfa_cpp-ZeroOneType.o -MD -MP -MF SynTree/$(DEPDIR)/driver_cfa_cpp-ZeroOneType.Tpo -c -o SynTree/driver_cfa_cpp-ZeroOneType.o `test -f 'SynTree/ZeroOneType.cc' || echo '$(srcdir)/'`SynTree/ZeroOneType.cc2094 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) SynTree/$(DEPDIR)/driver_cfa_cpp-ZeroOneType.Tpo SynTree/$(DEPDIR)/driver_cfa_cpp-ZeroOneType.Po2095 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='SynTree/ZeroOneType.cc' object='SynTree/driver_cfa_cpp-ZeroOneType.o' libtool=no @AMDEPBACKSLASH@2096 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@2097 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o SynTree/driver_cfa_cpp-ZeroOneType.o `test -f 'SynTree/ZeroOneType.cc' || echo '$(srcdir)/'`SynTree/ZeroOneType.cc2098 2099 SynTree/driver_cfa_cpp-ZeroOneType.obj: SynTree/ZeroOneType.cc2100 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT SynTree/driver_cfa_cpp-ZeroOneType.obj -MD -MP -MF SynTree/$(DEPDIR)/driver_cfa_cpp-ZeroOneType.Tpo -c -o SynTree/driver_cfa_cpp-ZeroOneType.obj `if test -f 'SynTree/ZeroOneType.cc'; then $(CYGPATH_W) 'SynTree/ZeroOneType.cc'; else $(CYGPATH_W) '$(srcdir)/SynTree/ZeroOneType.cc'; fi`2101 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) SynTree/$(DEPDIR)/driver_cfa_cpp-ZeroOneType.Tpo SynTree/$(DEPDIR)/driver_cfa_cpp-ZeroOneType.Po2102 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='SynTree/ZeroOneType.cc' object='SynTree/driver_cfa_cpp-ZeroOneType.obj' libtool=no @AMDEPBACKSLASH@2103 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@2104 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o SynTree/driver_cfa_cpp-ZeroOneType.obj `if test -f 'SynTree/ZeroOneType.cc'; then $(CYGPATH_W) 'SynTree/ZeroOneType.cc'; else $(CYGPATH_W) '$(srcdir)/SynTree/ZeroOneType.cc'; fi`2105 2066 2106 2067 SynTree/driver_cfa_cpp-Constant.o: SynTree/Constant.cc -
src/Parser/DeclarationNode.cc
raee7e35 r7b69174 10 10 // Created On : Sat May 16 12:34:05 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Mon Sep 26 22:18:40201613 // Update Count : 64012 // Last Modified On : Wed Sep 14 23:13:28 2016 13 // Update Count : 502 14 14 // 15 15 … … 31 31 32 32 // These must remain in the same order as the corresponding DeclarationNode enumerations. 33 const char * DeclarationNode::storageName[] = { "extern", "static", "auto", "register", "inline", "fortran", "_Noreturn", "_Thread_local", "NoStorageClass" };34 const char * DeclarationNode::qualifierName[] = { "const", "restrict", "volatile", "lvalue", "_Atomic", "NoQualifier" };35 const char * DeclarationNode::basicTypeName[] = { "void", "_Bool", "char", "int", "float", "double", "long double", "NoBasicType" };36 const char * DeclarationNode::complexTypeName[] = { "_Complex", "_Imaginary", "NoComplexType" };37 const char * DeclarationNode::signednessName[] = { "signed", "unsigned", "NoSignedness" };38 const char * DeclarationNode::lengthName[] = { "short", "long", "long long", "NoLength" };39 const char * DeclarationNode::aggregateName[] = { "struct", "union", "context" };40 const char * DeclarationNode::typeClassName[] = { "otype", "dtype", "ftype" };41 const char * DeclarationNode::builtinTypeName[] = { "__builtin_va_list" };33 const char *DeclarationNode::storageName[] = { "extern", "static", "auto", "register", "inline", "fortran", "_Noreturn", "_Thread_local", "NoStorageClass" }; 34 const char *DeclarationNode::qualifierName[] = { "const", "restrict", "volatile", "lvalue", "_Atomic", "NoQualifier" }; 35 const char *DeclarationNode::basicTypeName[] = { "void", "_Bool", "char", "int", "float", "double", "long double", "NoBasicType" }; 36 const char *DeclarationNode::complexTypeName[] = { "_Complex", "_Imaginary", "NoComplexType" }; 37 const char *DeclarationNode::signednessName[] = { "signed", "unsigned", "NoSignedness" }; 38 const char *DeclarationNode::lengthName[] = { "short", "long", "long long", "NoLength" }; 39 const char *DeclarationNode::aggregateName[] = { "struct", "union", "context" }; 40 const char *DeclarationNode::typeClassName[] = { "otype", "dtype", "ftype" }; 41 const char *DeclarationNode::builtinTypeName[] = { "__builtin_va_list" }; 42 42 43 43 UniqueName DeclarationNode::anonymous( "__anonymous" ); … … 46 46 47 47 DeclarationNode::DeclarationNode() : 48 type( nullptr),48 type( 0 ), 49 49 storageClass( NoStorageClass ), 50 50 isInline( false ), 51 51 isNoreturn( false ), 52 bitfieldWidth( nullptr),53 initializer( nullptr),52 bitfieldWidth( 0 ), 53 initializer( 0 ), 54 54 hasEllipsis( false ), 55 55 linkage( ::linkage ), 56 56 extension( false ) { 57 58 variable.name = nullptr;59 57 variable.tyClass = DeclarationNode::Otype; 60 58 variable.assertions = nullptr; 61 59 62 attr.name = nullptr;63 60 attr.expr = nullptr; 64 61 attr.type = nullptr; … … 66 63 67 64 DeclarationNode::~DeclarationNode() { 68 delete attr.name;69 65 delete attr.expr; 70 66 delete attr.type; 71 72 delete variable.name;73 delete variable.assertions;74 75 67 delete type; 76 68 delete bitfieldWidth; … … 78 70 } 79 71 80 DeclarationNode * DeclarationNode::clone() const {81 DeclarationNode * newnode = new DeclarationNode;72 DeclarationNode *DeclarationNode::clone() const { 73 DeclarationNode *newnode = new DeclarationNode; 82 74 newnode->type = maybeClone( type ); 83 newnode->name = name ? new string( *name ) : nullptr;75 newnode->name = name; 84 76 newnode->storageClass = storageClass; 85 77 newnode->isInline = isInline; … … 91 83 newnode->linkage = linkage; 92 84 93 newnode->variable.name = variable.name ? new string( *variable.name ) : nullptr; 85 newnode->variable.assertions = maybeClone( variable.assertions ); 86 newnode->variable.name = variable.name; 94 87 newnode->variable.tyClass = variable.tyClass; 95 newnode->variable.assertions = maybeClone( variable.assertions ); 96 97 newnode->attr.name = attr.name ? new string( *attr.name ) : nullptr; 88 98 89 newnode->attr.expr = maybeClone( attr.expr ); 99 90 newnode->attr.type = maybeClone( attr.type ); … … 107 98 void DeclarationNode::print( std::ostream &os, int indent ) const { 108 99 os << string( indent, ' ' ); 109 if ( name ) {110 os << *name << ": ";100 if ( name == "" ) { 101 os << "unnamed: "; 111 102 } else { 112 os << "unnamed: ";103 os << name << ": "; 113 104 } // if 114 105 … … 131 122 } // if 132 123 133 if ( initializer ) {124 if ( initializer != 0 ) { 134 125 os << endl << string( indent + 2, ' ' ) << "with initializer "; 135 126 initializer->printOneLine( os ); … … 148 139 } 149 140 150 DeclarationNode * DeclarationNode::newFunction( string * name, DeclarationNode * ret, DeclarationNode * param, StatementNode * body, bool newStyle ) { 151 DeclarationNode * newnode = new DeclarationNode; 152 newnode->name = name; 141 DeclarationNode *DeclarationNode::newFunction( std::string *name, DeclarationNode *ret, DeclarationNode *param, StatementNode *body, bool newStyle ) { 142 DeclarationNode *newnode = new DeclarationNode; 143 newnode->name = assign_strptr( name ); 144 153 145 newnode->type = new TypeData( TypeData::Function ); 154 146 newnode->type->function.params = param; 155 147 newnode->type->function.newStyle = newStyle; 156 148 newnode->type->function.body = body; 157 // ignore unnamed routine declarations: void p( int (*)(int) ); 158 if ( newnode->name ) { 159 typedefTable.addToEnclosingScope( *newnode->name, TypedefTable::ID ); 160 } // if 149 typedefTable.addToEnclosingScope( newnode->name, TypedefTable::ID ); 161 150 162 151 if ( body ) { … … 166 155 if ( ret ) { 167 156 newnode->type->base = ret->type; 168 ret->type = nullptr;157 ret->type = 0; 169 158 delete ret; 170 159 } // if … … 174 163 175 164 DeclarationNode * DeclarationNode::newQualifier( Qualifier q ) { 176 DeclarationNode * newnode = new DeclarationNode;165 DeclarationNode *newnode = new DeclarationNode; 177 166 newnode->type = new TypeData(); 178 167 newnode->type->qualifiers[ q ] = 1; … … 180 169 } // DeclarationNode::newQualifier 181 170 182 DeclarationNode * DeclarationNode::newForall( DeclarationNode * forall ) {183 DeclarationNode * newnode = new DeclarationNode;171 DeclarationNode * DeclarationNode::newForall( DeclarationNode *forall ) { 172 DeclarationNode *newnode = new DeclarationNode; 184 173 newnode->type = new TypeData( TypeData::Unknown ); 185 174 newnode->type->forall = forall; … … 188 177 189 178 DeclarationNode * DeclarationNode::newStorageClass( DeclarationNode::StorageClass sc ) { 190 DeclarationNode * newnode = new DeclarationNode; 179 DeclarationNode *newnode = new DeclarationNode; 180 //switch (sc) { 181 // case Inline: newnode->isInline = true; break; 182 // case Noreturn: newnode->isNoreturn = true; break; 183 // default: newnode->storageClass = sc; break; 184 //} 191 185 newnode->storageClass = sc; 192 186 return newnode; … … 194 188 195 189 DeclarationNode * DeclarationNode::newBasicType( BasicType bt ) { 196 DeclarationNode * newnode = new DeclarationNode;190 DeclarationNode *newnode = new DeclarationNode; 197 191 newnode->type = new TypeData( TypeData::Basic ); 198 192 newnode->type->basictype = bt; … … 201 195 202 196 DeclarationNode * DeclarationNode::newComplexType( ComplexType ct ) { 203 DeclarationNode * newnode = new DeclarationNode;197 DeclarationNode *newnode = new DeclarationNode; 204 198 newnode->type = new TypeData( TypeData::Basic ); 205 199 newnode->type->complextype = ct; … … 208 202 209 203 DeclarationNode * DeclarationNode::newSignedNess( Signedness sn ) { 210 DeclarationNode * newnode = new DeclarationNode;204 DeclarationNode *newnode = new DeclarationNode; 211 205 newnode->type = new TypeData( TypeData::Basic ); 212 206 newnode->type->signedness = sn; … … 215 209 216 210 DeclarationNode * DeclarationNode::newLength( Length lnth ) { 217 DeclarationNode * newnode = new DeclarationNode;211 DeclarationNode *newnode = new DeclarationNode; 218 212 newnode->type = new TypeData( TypeData::Basic ); 219 213 newnode->type->length = lnth; … … 221 215 } // DeclarationNode::newLength 222 216 223 DeclarationNode * DeclarationNode::newFromTypedef( st ring *name ) {224 DeclarationNode * newnode = new DeclarationNode;217 DeclarationNode * DeclarationNode::newFromTypedef( std::string *name ) { 218 DeclarationNode *newnode = new DeclarationNode; 225 219 newnode->type = new TypeData( TypeData::SymbolicInst ); 226 newnode->type->symbolic.name = name;220 newnode->type->symbolic.name = assign_strptr( name ); 227 221 newnode->type->symbolic.isTypedef = true; 228 newnode->type->symbolic.params = nullptr;222 newnode->type->symbolic.params = 0; 229 223 return newnode; 230 224 } // DeclarationNode::newFromTypedef 231 225 232 DeclarationNode * DeclarationNode::newAggregate( Aggregate kind, const st ring * name, ExpressionNode * actuals, DeclarationNode *fields, bool body ) {233 DeclarationNode * newnode = new DeclarationNode;226 DeclarationNode * DeclarationNode::newAggregate( Aggregate kind, const std::string *name, ExpressionNode *actuals, DeclarationNode *fields, bool body ) { 227 DeclarationNode *newnode = new DeclarationNode; 234 228 newnode->type = new TypeData( TypeData::Aggregate ); 235 229 newnode->type->aggregate.kind = kind; 236 if ( name ) { 237 newnode->type->aggregate.name = name; 238 } else { // anonymous aggregate ? 239 newnode->type->aggregate.name = new string( anonymous.newName() ); 230 newnode->type->aggregate.name = assign_strptr( name ); 231 if ( newnode->type->aggregate.name == "" ) { // anonymous aggregate ? 232 newnode->type->aggregate.name = anonymous.newName(); 240 233 } // if 241 234 newnode->type->aggregate.actuals = actuals; … … 245 238 } // DeclarationNode::newAggregate 246 239 247 DeclarationNode * DeclarationNode::newEnum( string * name, DeclarationNode * constants ) { 248 DeclarationNode * newnode = new DeclarationNode; 240 DeclarationNode *DeclarationNode::newEnum( std::string *name, DeclarationNode *constants ) { 241 DeclarationNode *newnode = new DeclarationNode; 242 newnode->name = assign_strptr( name ); 249 243 newnode->type = new TypeData( TypeData::Enum ); 250 if ( name ) { 251 newnode->type->enumeration.name = name; 252 } else { // anonymous aggregate ? 253 newnode->type->enumeration.name = new string( anonymous.newName() ); 244 newnode->type->enumeration.name = newnode->name; 245 if ( newnode->type->enumeration.name == "" ) { // anonymous enumeration ? 246 newnode->type->enumeration.name = DeclarationNode::anonymous.newName(); 254 247 } // if 255 248 newnode->type->enumeration.constants = constants; … … 257 250 } // DeclarationNode::newEnum 258 251 259 DeclarationNode * DeclarationNode::newEnumConstant( string * name, ExpressionNode *constant ) {260 DeclarationNode * newnode = new DeclarationNode;261 newnode->name = name;252 DeclarationNode *DeclarationNode::newEnumConstant( std::string *name, ExpressionNode *constant ) { 253 DeclarationNode *newnode = new DeclarationNode; 254 newnode->name = assign_strptr( name ); 262 255 newnode->enumeratorValue.reset( constant ); 263 typedefTable.addToEnclosingScope( *newnode->name, TypedefTable::ID );256 typedefTable.addToEnclosingScope( newnode->name, TypedefTable::ID ); 264 257 return newnode; 265 258 } // DeclarationNode::newEnumConstant 266 259 267 DeclarationNode * DeclarationNode::newName( string *name ) {268 DeclarationNode * newnode = new DeclarationNode;269 newnode->name = name;260 DeclarationNode *DeclarationNode::newName( std::string *name ) { 261 DeclarationNode *newnode = new DeclarationNode; 262 newnode->name = assign_strptr( name ); 270 263 return newnode; 271 264 } // DeclarationNode::newName 272 265 273 DeclarationNode * DeclarationNode::newFromTypeGen( string * name, ExpressionNode *params ) {274 DeclarationNode * newnode = new DeclarationNode;266 DeclarationNode *DeclarationNode::newFromTypeGen( std::string *name, ExpressionNode *params ) { 267 DeclarationNode *newnode = new DeclarationNode; 275 268 newnode->type = new TypeData( TypeData::SymbolicInst ); 276 newnode->type->symbolic.name = name;269 newnode->type->symbolic.name = assign_strptr( name ); 277 270 newnode->type->symbolic.isTypedef = false; 278 271 newnode->type->symbolic.actuals = params; … … 280 273 } // DeclarationNode::newFromTypeGen 281 274 282 DeclarationNode * DeclarationNode::newTypeParam( TypeClass tc, string * name ) { 283 DeclarationNode * newnode = new DeclarationNode; 284 newnode->type = nullptr; 275 DeclarationNode *DeclarationNode::newTypeParam( TypeClass tc, std::string *name ) { 276 DeclarationNode *newnode = new DeclarationNode; 277 newnode->name = assign_strptr( name ); 278 newnode->type = new TypeData( TypeData::Variable ); 285 279 newnode->variable.tyClass = tc; 286 newnode->variable.name = n ame;280 newnode->variable.name = newnode->name; 287 281 return newnode; 288 282 } // DeclarationNode::newTypeParam 289 283 290 DeclarationNode * DeclarationNode::newTrait( const string * name, DeclarationNode * params, DeclarationNode *asserts ) {291 DeclarationNode * newnode = new DeclarationNode;284 DeclarationNode *DeclarationNode::newTrait( std::string *name, DeclarationNode *params, DeclarationNode *asserts ) { 285 DeclarationNode *newnode = new DeclarationNode; 292 286 newnode->type = new TypeData( TypeData::Aggregate ); 293 newnode->type->aggregate.name = name;294 287 newnode->type->aggregate.kind = Trait; 295 288 newnode->type->aggregate.params = params; 296 289 newnode->type->aggregate.fields = asserts; 290 newnode->type->aggregate.name = assign_strptr( name ); 297 291 return newnode; 298 292 } // DeclarationNode::newTrait 299 293 300 DeclarationNode * DeclarationNode::newTraitUse( const string * name, ExpressionNode *params ) {301 DeclarationNode * newnode = new DeclarationNode;294 DeclarationNode *DeclarationNode::newTraitUse( std::string *name, ExpressionNode *params ) { 295 DeclarationNode *newnode = new DeclarationNode; 302 296 newnode->type = new TypeData( TypeData::AggregateInst ); 303 297 newnode->type->aggInst.aggregate = new TypeData( TypeData::Aggregate ); 304 298 newnode->type->aggInst.aggregate->aggregate.kind = Trait; 305 newnode->type->aggInst.aggregate->aggregate.name = name;299 newnode->type->aggInst.aggregate->aggregate.name = assign_strptr( name ); 306 300 newnode->type->aggInst.params = params; 307 301 return newnode; 308 302 } // DeclarationNode::newTraitUse 309 303 310 DeclarationNode * DeclarationNode::newTypeDecl( string * name, DeclarationNode * typeParams ) { 311 DeclarationNode * newnode = new DeclarationNode; 304 DeclarationNode *DeclarationNode::newTypeDecl( std::string *name, DeclarationNode *typeParams ) { 305 DeclarationNode *newnode = new DeclarationNode; 306 newnode->name = assign_strptr( name ); 312 307 newnode->type = new TypeData( TypeData::Symbolic ); 313 308 newnode->type->symbolic.isTypedef = false; 314 309 newnode->type->symbolic.params = typeParams; 315 newnode->type->symbolic.name = n ame;310 newnode->type->symbolic.name = newnode->name; 316 311 return newnode; 317 312 } // DeclarationNode::newTypeDecl 318 313 319 DeclarationNode * DeclarationNode::newPointer( DeclarationNode *qualifiers ) {320 DeclarationNode * newnode = new DeclarationNode;314 DeclarationNode *DeclarationNode::newPointer( DeclarationNode *qualifiers ) { 315 DeclarationNode *newnode = new DeclarationNode; 321 316 newnode->type = new TypeData( TypeData::Pointer ); 322 317 return newnode->addQualifiers( qualifiers ); 323 318 } // DeclarationNode::newPointer 324 319 325 DeclarationNode * DeclarationNode::newArray( ExpressionNode * size, DeclarationNode *qualifiers, bool isStatic ) {326 DeclarationNode * newnode = new DeclarationNode;320 DeclarationNode *DeclarationNode::newArray( ExpressionNode *size, DeclarationNode *qualifiers, bool isStatic ) { 321 DeclarationNode *newnode = new DeclarationNode; 327 322 newnode->type = new TypeData( TypeData::Array ); 328 323 newnode->type->array.dimension = size; 329 324 newnode->type->array.isStatic = isStatic; 330 if ( newnode->type->array.dimension == nullptr || newnode->type->array.dimension->isExpressionType<ConstantExpr *>() ) {325 if ( newnode->type->array.dimension == 0 || newnode->type->array.dimension->isExpressionType<ConstantExpr *>() ) { 331 326 newnode->type->array.isVarLen = false; 332 327 } else { … … 336 331 } // DeclarationNode::newArray 337 332 338 DeclarationNode * DeclarationNode::newVarArray( DeclarationNode *qualifiers ) {339 DeclarationNode * newnode = new DeclarationNode;333 DeclarationNode *DeclarationNode::newVarArray( DeclarationNode *qualifiers ) { 334 DeclarationNode *newnode = new DeclarationNode; 340 335 newnode->type = new TypeData( TypeData::Array ); 341 newnode->type->array.dimension = nullptr;336 newnode->type->array.dimension = 0; 342 337 newnode->type->array.isStatic = false; 343 338 newnode->type->array.isVarLen = true; … … 345 340 } 346 341 347 DeclarationNode * DeclarationNode::newBitfield( ExpressionNode *size ) {348 DeclarationNode * newnode = new DeclarationNode;342 DeclarationNode *DeclarationNode::newBitfield( ExpressionNode *size ) { 343 DeclarationNode *newnode = new DeclarationNode; 349 344 newnode->bitfieldWidth = size; 350 345 return newnode; 351 346 } 352 347 353 DeclarationNode * DeclarationNode::newTuple( DeclarationNode *members ) {354 DeclarationNode * newnode = new DeclarationNode;348 DeclarationNode *DeclarationNode::newTuple( DeclarationNode *members ) { 349 DeclarationNode *newnode = new DeclarationNode; 355 350 newnode->type = new TypeData( TypeData::Tuple ); 356 351 newnode->type->tuple = members; … … 358 353 } 359 354 360 DeclarationNode * DeclarationNode::newTypeof( ExpressionNode *expr ) {361 DeclarationNode * newnode = new DeclarationNode;355 DeclarationNode *DeclarationNode::newTypeof( ExpressionNode *expr ) { 356 DeclarationNode *newnode = new DeclarationNode; 362 357 newnode->type = new TypeData( TypeData::Typeof ); 363 358 newnode->type->typeexpr = expr; … … 366 361 367 362 DeclarationNode * DeclarationNode::newBuiltinType( BuiltinType bt ) { 368 DeclarationNode * newnode = new DeclarationNode;363 DeclarationNode *newnode = new DeclarationNode; 369 364 newnode->type = new TypeData( TypeData::Builtin ); 370 365 newnode->builtin = bt; … … 372 367 } // DeclarationNode::newBuiltinType 373 368 374 DeclarationNode * DeclarationNode::newAttr( string * name, ExpressionNode *expr ) {375 DeclarationNode * newnode = new DeclarationNode;376 newnode->type = n ullptr;377 newnode->attr.name = name;369 DeclarationNode *DeclarationNode::newAttr( std::string *name, ExpressionNode *expr ) { 370 DeclarationNode *newnode = new DeclarationNode; 371 newnode->type = new TypeData( TypeData::Attr ); 372 newnode->attr.name = assign_strptr( name ); 378 373 newnode->attr.expr = expr; 379 374 return newnode; 380 375 } 381 376 382 DeclarationNode * DeclarationNode::newAttr( string * name, DeclarationNode *type ) {383 DeclarationNode * newnode = new DeclarationNode;384 newnode->type = n ullptr;385 newnode->attr.name = name;377 DeclarationNode *DeclarationNode::newAttr( std::string *name, DeclarationNode *type ) { 378 DeclarationNode *newnode = new DeclarationNode; 379 newnode->type = new TypeData( TypeData::Attr ); 380 newnode->attr.name = assign_strptr( name ); 386 381 newnode->attr.type = type; 387 382 return newnode; … … 394 389 } // appendError 395 390 396 void DeclarationNode::checkQualifiers( const TypeData * src, const TypeData *dst ) {391 void DeclarationNode::checkQualifiers( const TypeData *src, const TypeData *dst ) { 397 392 TypeData::Qualifiers qsrc = src->qualifiers, qdst = dst->qualifiers; // optimization 398 393 … … 406 401 } // DeclarationNode::checkQualifiers 407 402 408 void DeclarationNode::checkStorageClasses( DeclarationNode * q ) {403 void DeclarationNode::checkStorageClasses( DeclarationNode *q ) { 409 404 if ( storageClass != NoStorageClass && q->storageClass != NoStorageClass ) { 410 405 if ( storageClass == q->storageClass ) { // duplicate qualifier … … 418 413 } // DeclarationNode::copyStorageClasses 419 414 420 DeclarationNode * DeclarationNode::copyStorageClasses( DeclarationNode *q ) {415 DeclarationNode *DeclarationNode::copyStorageClasses( DeclarationNode *q ) { 421 416 isInline = isInline || q->isInline; 422 417 isNoreturn = isNoreturn || q->isNoreturn; … … 429 424 } // DeclarationNode::copyStorageClasses 430 425 431 static void addQualifiersToType( TypeData *&src, TypeData * dst ) {426 static void addQualifiersToType( TypeData *&src, TypeData *dst ) { 432 427 if ( src->forall && dst->kind == TypeData::Function ) { 433 428 if ( dst->forall ) { … … 436 431 dst->forall = src->forall; 437 432 } // if 438 src->forall = nullptr;433 src->forall = 0; 439 434 } // if 440 435 if ( dst->base ) { … … 442 437 } else if ( dst->kind == TypeData::Function ) { 443 438 dst->base = src; 444 src = nullptr;439 src = 0; 445 440 } else { 446 441 dst->qualifiers |= src->qualifiers; … … 448 443 } // addQualifiersToType 449 444 450 DeclarationNode * DeclarationNode::addQualifiers( DeclarationNode *q ) {451 if ( ! q ) { delete q; return this; }445 DeclarationNode *DeclarationNode::addQualifiers( DeclarationNode *q ) { 446 if ( ! q ) return this; 452 447 453 448 checkStorageClasses( q ); 454 449 copyStorageClasses( q ); 455 450 456 if ( ! q->type ) { 457 delete q; 458 return this; 459 } // if 451 if ( ! q->type ) { delete q; return this; } 460 452 461 453 if ( ! type ) { 462 type = q->type; // reuse this structure 463 q->type = nullptr; 464 delete q; 454 // type = new TypeData; 455 type = q->type; 465 456 return this; 466 457 } // if … … 476 467 type->aggregate.params = q->type->forall; 477 468 // change implicit typedef from TYPEDEFname to TYPEGENname 478 typedefTable.changeKind( *type->aggregate.name, TypedefTable::TG );469 typedefTable.changeKind( type->aggregate.name, TypedefTable::TG ); 479 470 } else { 480 471 type->forall = q->type->forall; 481 472 } // if 482 473 } // if 483 q->type->forall = nullptr;474 q->type->forall = 0; 484 475 } // if 485 476 delete q; … … 494 485 dst->forall = src->forall; 495 486 } // if 496 src->forall = nullptr;487 src->forall = 0; 497 488 } // if 498 489 if ( dst->base ) { … … 503 494 src->qualifiers |= dst->qualifiers; 504 495 dst = src; 505 src = nullptr;496 src = 0; 506 497 break; 507 498 case TypeData::Basic: … … 513 504 dst->basictype = src->basictype; 514 505 } else if ( src->basictype != DeclarationNode::NoBasicType ) 515 throw SemanticError( st ring( "conflicting type specifier " ) + DeclarationNode::basicTypeName[ src->basictype ] + " in type: ", src );506 throw SemanticError( std::string( "conflicting type specifier " ) + DeclarationNode::basicTypeName[ src->basictype ] + " in type: ", src ); 516 507 517 508 if ( dst->complextype == DeclarationNode::NoComplexType ) { 518 509 dst->complextype = src->complextype; 519 510 } else if ( src->complextype != DeclarationNode::NoComplexType ) 520 throw SemanticError( st ring( "conflicting type specifier " ) + DeclarationNode::complexTypeName[ src->complextype ] + " in type: ", src );511 throw SemanticError( std::string( "conflicting type specifier " ) + DeclarationNode::complexTypeName[ src->complextype ] + " in type: ", src ); 521 512 522 513 if ( dst->signedness == DeclarationNode::NoSignedness ) { 523 514 dst->signedness = src->signedness; 524 515 } else if ( src->signedness != DeclarationNode::NoSignedness ) 525 throw SemanticError( st ring( "conflicting type specifier " ) + DeclarationNode::signednessName[ src->signedness ] + " in type: ", src );516 throw SemanticError( std::string( "conflicting type specifier " ) + DeclarationNode::signednessName[ src->signedness ] + " in type: ", src ); 526 517 527 518 if ( dst->length == DeclarationNode::NoLength ) { … … 530 521 dst->length = DeclarationNode::LongLong; 531 522 } else if ( src->length != DeclarationNode::NoLength ) 532 throw SemanticError( st ring( "conflicting type specifier " ) + DeclarationNode::lengthName[ src->length ] + " in type: ", src );523 throw SemanticError( std::string( "conflicting type specifier " ) + DeclarationNode::lengthName[ src->length ] + " in type: ", src ); 533 524 } // if 534 525 break; … … 543 534 } // if 544 535 dst->base->qualifiers |= src->qualifiers; 545 src = nullptr;536 src = 0; 546 537 break; 547 538 default: … … 551 542 dst->forall = src->forall; 552 543 } // if 553 src->forall = nullptr;544 src->forall = 0; 554 545 dst->base = src; 555 src = nullptr;546 src = 0; 556 547 } // switch 557 548 } // switch … … 559 550 } 560 551 561 DeclarationNode * DeclarationNode::addType( DeclarationNode *o ) {552 DeclarationNode *DeclarationNode::addType( DeclarationNode *o ) { 562 553 if ( o ) { 563 554 checkStorageClasses( o ); … … 575 566 type = o->type; 576 567 } // if 577 o->type = nullptr;568 o->type = 0; 578 569 } else { 579 570 addTypeToType( o->type, type ); … … 593 584 } 594 585 595 DeclarationNode * DeclarationNode::addTypedef() {596 TypeData * newtype = new TypeData( TypeData::Symbolic );597 newtype->symbolic.params = nullptr;586 DeclarationNode *DeclarationNode::addTypedef() { 587 TypeData *newtype = new TypeData( TypeData::Symbolic ); 588 newtype->symbolic.params = 0; 598 589 newtype->symbolic.isTypedef = true; 599 newtype->symbolic.name = name ? new string( *name ) : nullptr;590 newtype->symbolic.name = name; 600 591 newtype->base = type; 601 592 type = newtype; … … 603 594 } 604 595 605 DeclarationNode * DeclarationNode::addAssertions( DeclarationNode * assertions ) { 606 if ( variable.name ) { 607 if ( variable.assertions ) { 608 variable.assertions->appendList( assertions ); 609 } else { 610 variable.assertions = assertions; 611 } // if 612 return this; 613 } // if 614 596 DeclarationNode *DeclarationNode::addAssertions( DeclarationNode *assertions ) { 615 597 assert( type ); 616 598 switch ( type->kind ) { … … 622 604 } // if 623 605 break; 624 //case TypeData::Variable:625 //if ( variable.assertions ) {626 //variable.assertions->appendList( assertions );627 //} else {628 //variable.assertions = assertions;629 //} // if630 //break;606 case TypeData::Variable: 607 if ( variable.assertions ) { 608 variable.assertions->appendList( assertions ); 609 } else { 610 variable.assertions = assertions; 611 } // if 612 break; 631 613 default: 632 614 assert( false ); … … 636 618 } 637 619 638 DeclarationNode * DeclarationNode::addName( string * newname ) { 639 assert( ! name ); 640 name = newname; 641 return this; 642 } 643 644 DeclarationNode * DeclarationNode::addBitfield( ExpressionNode * size ) { 620 DeclarationNode *DeclarationNode::addName( std::string *newname ) { 621 name = assign_strptr( newname ); 622 return this; 623 } 624 625 DeclarationNode *DeclarationNode::addBitfield( ExpressionNode *size ) { 645 626 bitfieldWidth = size; 646 627 return this; 647 628 } 648 629 649 DeclarationNode * DeclarationNode::addVarArgs() {630 DeclarationNode *DeclarationNode::addVarArgs() { 650 631 assert( type ); 651 632 hasEllipsis = true; … … 653 634 } 654 635 655 DeclarationNode * DeclarationNode::addFunctionBody( StatementNode *body ) {636 DeclarationNode *DeclarationNode::addFunctionBody( StatementNode *body ) { 656 637 assert( type ); 657 638 assert( type->kind == TypeData::Function ); 658 assert( ! type->function.body);639 assert( type->function.body == 0 ); 659 640 type->function.body = body; 660 641 type->function.hasBody = true; … … 662 643 } 663 644 664 DeclarationNode * DeclarationNode::addOldDeclList( DeclarationNode *list ) {645 DeclarationNode *DeclarationNode::addOldDeclList( DeclarationNode *list ) { 665 646 assert( type ); 666 647 assert( type->kind == TypeData::Function ); 667 assert( ! type->function.oldDeclList);648 assert( type->function.oldDeclList == 0 ); 668 649 type->function.oldDeclList = list; 669 650 return this; 670 651 } 671 652 672 static void setBase( TypeData *&type, TypeData * newType ) {653 static void setBase( TypeData *&type, TypeData *newType ) { 673 654 if ( type ) { 674 TypeData * prevBase = type;675 TypeData * curBase = type->base;676 while ( curBase != nullptr) {655 TypeData *prevBase = type; 656 TypeData *curBase = type->base; 657 while ( curBase != 0 ) { 677 658 prevBase = curBase; 678 659 curBase = curBase->base; … … 684 665 } 685 666 686 DeclarationNode * DeclarationNode::addPointer( DeclarationNode *p ) {667 DeclarationNode *DeclarationNode::addPointer( DeclarationNode *p ) { 687 668 if ( p ) { 688 669 assert( p->type->kind == TypeData::Pointer ); 689 670 setBase( type, p->type ); 690 p->type = nullptr;671 p->type = 0; 691 672 delete p; 692 673 } // if … … 694 675 } 695 676 696 DeclarationNode * DeclarationNode::addArray( DeclarationNode *a ) {677 DeclarationNode *DeclarationNode::addArray( DeclarationNode *a ) { 697 678 if ( a ) { 698 679 assert( a->type->kind == TypeData::Array ); 699 680 setBase( type, a->type ); 700 a->type = nullptr;681 a->type = 0; 701 682 delete a; 702 683 } // if … … 704 685 } 705 686 706 DeclarationNode * DeclarationNode::addNewPointer( DeclarationNode *p ) {687 DeclarationNode *DeclarationNode::addNewPointer( DeclarationNode *p ) { 707 688 if ( p ) { 708 689 assert( p->type->kind == TypeData::Pointer ); … … 722 703 p->type->base = type; 723 704 } // switch 724 type = nullptr;705 type = 0; 725 706 } // if 726 707 delete this; … … 731 712 } 732 713 733 static TypeData * findLast( TypeData *a ) {714 static TypeData *findLast( TypeData *a ) { 734 715 assert( a ); 735 TypeData * cur = a;716 TypeData *cur = a; 736 717 while ( cur->base ) { 737 718 cur = cur->base; … … 740 721 } 741 722 742 DeclarationNode * DeclarationNode::addNewArray( DeclarationNode *a ) {723 DeclarationNode *DeclarationNode::addNewArray( DeclarationNode *a ) { 743 724 if ( a ) { 744 725 assert( a->type->kind == TypeData::Array ); 745 TypeData * lastArray = findLast( a->type );726 TypeData *lastArray = findLast( a->type ); 746 727 if ( type ) { 747 728 switch ( type->kind ) { … … 758 739 lastArray->base = type; 759 740 } // switch 760 type = nullptr;741 type = 0; 761 742 } // if 762 743 delete this; … … 767 748 } 768 749 769 DeclarationNode * DeclarationNode::addParamList( DeclarationNode *params ) {770 TypeData * ftype = new TypeData( TypeData::Function );750 DeclarationNode *DeclarationNode::addParamList( DeclarationNode *params ) { 751 TypeData *ftype = new TypeData( TypeData::Function ); 771 752 ftype->function.params = params; 772 753 setBase( type, ftype ); … … 774 755 } 775 756 776 static TypeData * addIdListToType( TypeData * type, DeclarationNode *ids ) {757 static TypeData *addIdListToType( TypeData *type, DeclarationNode *ids ) { 777 758 if ( type ) { 778 759 if ( type->kind != TypeData::Function ) { … … 783 764 return type; 784 765 } else { 785 TypeData * newtype = new TypeData( TypeData::Function );766 TypeData *newtype = new TypeData( TypeData::Function ); 786 767 newtype->function.idList = ids; 787 768 return newtype; 788 769 } // if 789 } // addIdListToType790 791 DeclarationNode * DeclarationNode::addIdList( DeclarationNode *ids ) {770 } 771 772 DeclarationNode *DeclarationNode::addIdList( DeclarationNode *ids ) { 792 773 type = addIdListToType( type, ids ); 793 774 return this; 794 775 } 795 776 796 DeclarationNode * DeclarationNode::addInitializer( InitializerNode * init ) { 777 DeclarationNode *DeclarationNode::addInitializer( InitializerNode *init ) { 778 //assert 797 779 initializer = init; 798 780 return this; 799 781 } 800 782 801 DeclarationNode * DeclarationNode::cloneType( string * newName ) { 802 DeclarationNode * newnode = new DeclarationNode; 783 DeclarationNode *DeclarationNode::cloneBaseType( string *newName ) { 784 DeclarationNode *newnode = new DeclarationNode; 785 TypeData *srcType = type; 786 while ( srcType->base ) { 787 srcType = srcType->base; 788 } // while 789 newnode->type = maybeClone( srcType ); 790 if ( newnode->type->kind == TypeData::AggregateInst ) { 791 // don't duplicate members 792 if ( newnode->type->aggInst.aggregate->kind == TypeData::Enum ) { 793 delete newnode->type->aggInst.aggregate->enumeration.constants; 794 newnode->type->aggInst.aggregate->enumeration.constants = 0; 795 } else { 796 assert( newnode->type->aggInst.aggregate->kind == TypeData::Aggregate ); 797 delete newnode->type->aggInst.aggregate->aggregate.fields; 798 newnode->type->aggInst.aggregate->aggregate.fields = 0; 799 } // if 800 } // if 801 newnode->type->forall = maybeClone( type->forall ); 802 assert( storageClass == NoStorageClass ); 803 newnode->copyStorageClasses( this ); 804 newnode->name = assign_strptr( newName ); 805 return newnode; 806 } 807 808 DeclarationNode *DeclarationNode::cloneBaseType( DeclarationNode *o ) { 809 if ( o ) { 810 o->copyStorageClasses( this ); 811 if ( type ) { 812 TypeData *srcType = type; 813 while ( srcType->base ) { 814 srcType = srcType->base; 815 } // while 816 TypeData *newType = srcType->clone(); 817 if ( newType->kind == TypeData::AggregateInst ) { 818 // don't duplicate members 819 if ( newType->aggInst.aggregate->kind == TypeData::Enum ) { 820 delete newType->aggInst.aggregate->enumeration.constants; 821 newType->aggInst.aggregate->enumeration.constants = 0; 822 } else { 823 assert( newType->aggInst.aggregate->kind == TypeData::Aggregate ); 824 delete newType->aggInst.aggregate->aggregate.fields; 825 newType->aggInst.aggregate->aggregate.fields = 0; 826 } // if 827 } // if 828 newType->forall = maybeClone( type->forall ); 829 if ( ! o->type ) { 830 o->type = newType; 831 } else { 832 addTypeToType( newType, o->type ); 833 delete newType; 834 } // if 835 } // if 836 } // if 837 return o; 838 } 839 840 DeclarationNode *DeclarationNode::cloneType( string *newName ) { 841 DeclarationNode *newnode = new DeclarationNode; 803 842 newnode->type = maybeClone( type ); 804 843 assert( storageClass == NoStorageClass ); 805 844 newnode->copyStorageClasses( this ); 806 assert( newName ); 807 newnode->name = newName; 808 return newnode; 809 } 810 811 DeclarationNode * DeclarationNode::cloneBaseType( DeclarationNode * o ) { 812 if ( ! o ) return nullptr; 813 814 o->copyStorageClasses( this ); 845 newnode->name = assign_strptr( newName ); 846 return newnode; 847 } 848 849 DeclarationNode *DeclarationNode::cloneType( DeclarationNode *o ) { 850 if ( o ) { 851 assert( storageClass == NoStorageClass ); 852 o->copyStorageClasses( this ); 853 if ( type ) { 854 TypeData *newType = type->clone(); 855 if ( ! o->type ) { 856 o->type = newType; 857 } else { 858 addTypeToType( newType, o->type ); 859 delete newType; 860 } // if 861 } // if 862 } // if 863 delete o; 864 return o; 865 } 866 867 DeclarationNode *DeclarationNode::extractAggregate() const { 815 868 if ( type ) { 816 TypeData * srcType = type; 817 818 while ( srcType->base ) { 819 srcType = srcType->base; 820 } // while 821 822 TypeData * newType = srcType->clone(); 823 if ( newType->kind == TypeData::AggregateInst ) { 824 // don't duplicate members 825 if ( newType->aggInst.aggregate->kind == TypeData::Enum ) { 826 delete newType->aggInst.aggregate->enumeration.constants; 827 newType->aggInst.aggregate->enumeration.constants = nullptr; 828 } else { 829 assert( newType->aggInst.aggregate->kind == TypeData::Aggregate ); 830 delete newType->aggInst.aggregate->aggregate.fields; 831 newType->aggInst.aggregate->aggregate.fields = nullptr; 832 } // if 833 } // if 834 835 newType->forall = maybeClone( type->forall ); 836 if ( ! o->type ) { 837 o->type = newType; 838 } else { 839 addTypeToType( newType, o->type ); 840 delete newType; 841 } // if 842 } // if 843 return o; 844 } 845 846 DeclarationNode * DeclarationNode::extractAggregate() const { 847 if ( type ) { 848 TypeData * ret = typeextractAggregate( type ); 869 TypeData *ret = typeextractAggregate( type ); 849 870 if ( ret ) { 850 DeclarationNode * newnode = new DeclarationNode;871 DeclarationNode *newnode = new DeclarationNode; 851 872 newnode->type = ret; 852 873 return newnode; 853 874 } // if 854 875 } // if 855 return nullptr;856 } 857 858 void buildList( const DeclarationNode * firstNode, std::list< Declaration * > &outputList ) {876 return 0; 877 } 878 879 void buildList( const DeclarationNode *firstNode, std::list< Declaration * > &outputList ) { 859 880 SemanticError errors; 860 881 std::back_insert_iterator< std::list< Declaration * > > out( outputList ); 861 const DeclarationNode * cur = firstNode; 862 882 const DeclarationNode *cur = firstNode; 863 883 while ( cur ) { 864 884 try { 865 if ( DeclarationNode * extr = cur->extractAggregate() ) {885 if ( DeclarationNode *extr = cur->extractAggregate() ) { 866 886 // handle the case where a structure declaration is contained within an object or type declaration 867 Declaration * decl = extr->build();887 Declaration *decl = extr->build(); 868 888 if ( decl ) { 869 * out++ = decl;889 *out++ = decl; 870 890 } // if 871 891 delete extr; 872 892 } // if 873 874 Declaration * decl = cur->build(); 893 Declaration *decl = cur->build(); 875 894 if ( decl ) { 876 * out++ = decl;895 *out++ = decl; 877 896 } // if 878 897 } catch( SemanticError &e ) { … … 881 900 cur = dynamic_cast< DeclarationNode * >( cur->get_next() ); 882 901 } // while 883 884 902 if ( ! errors.isEmpty() ) { 885 903 throw errors; 886 904 } // if 887 } // buildList888 889 void buildList( const DeclarationNode * firstNode, std::list< DeclarationWithType * > &outputList ) {905 } 906 907 void buildList( const DeclarationNode *firstNode, std::list< DeclarationWithType * > &outputList ) { 890 908 SemanticError errors; 891 909 std::back_insert_iterator< std::list< DeclarationWithType * > > out( outputList ); 892 const DeclarationNode * cur = firstNode;910 const DeclarationNode *cur = firstNode; 893 911 while ( cur ) { 894 912 try { 895 Declaration * decl = cur->build();913 Declaration *decl = cur->build(); 896 914 if ( decl ) { 897 if ( DeclarationWithType * dwt = dynamic_cast< DeclarationWithType * >( decl ) ) {898 * out++ = dwt;899 } else if ( StructDecl * agg = dynamic_cast< StructDecl * >( decl ) ) {900 StructInstType * inst = new StructInstType( Type::Qualifiers(), agg->get_name() );901 * out++ = new ObjectDecl( "", DeclarationNode::NoStorageClass, linkage, nullptr, inst, nullptr);915 if ( DeclarationWithType *dwt = dynamic_cast< DeclarationWithType * >( decl ) ) { 916 *out++ = dwt; 917 } else if ( StructDecl *agg = dynamic_cast< StructDecl * >( decl ) ) { 918 StructInstType *inst = new StructInstType( Type::Qualifiers(), agg->get_name() ); 919 *out++ = new ObjectDecl( "", DeclarationNode::NoStorageClass, linkage, 0, inst, 0 ); 902 920 delete agg; 903 } else if ( UnionDecl * agg = dynamic_cast< UnionDecl * >( decl ) ) {904 UnionInstType * inst = new UnionInstType( Type::Qualifiers(), agg->get_name() );905 * out++ = new ObjectDecl( "", DeclarationNode::NoStorageClass, linkage, nullptr, inst, nullptr);921 } else if ( UnionDecl *agg = dynamic_cast< UnionDecl * >( decl ) ) { 922 UnionInstType *inst = new UnionInstType( Type::Qualifiers(), agg->get_name() ); 923 *out++ = new ObjectDecl( "", DeclarationNode::NoStorageClass, linkage, 0, inst, 0 ); 906 924 } // if 907 925 } // if … … 914 932 throw errors; 915 933 } // if 916 } // buildList917 918 void buildTypeList( const DeclarationNode * firstNode, std::list< Type * > &outputList ) {934 } 935 936 void buildTypeList( const DeclarationNode *firstNode, std::list< Type * > &outputList ) { 919 937 SemanticError errors; 920 938 std::back_insert_iterator< std::list< Type * > > out( outputList ); 921 const DeclarationNode * cur = firstNode; 922 939 const DeclarationNode *cur = firstNode; 923 940 while ( cur ) { 924 941 try { 925 * out++ = cur->buildType();942 *out++ = cur->buildType(); 926 943 } catch( SemanticError &e ) { 927 944 errors.append( e ); … … 929 946 cur = dynamic_cast< DeclarationNode * >( cur->get_next() ); 930 947 } // while 931 932 948 if ( ! errors.isEmpty() ) { 933 949 throw errors; 934 950 } // if 935 } // buildTypeList936 937 Declaration * DeclarationNode::build() const {951 } 952 953 Declaration *DeclarationNode::build() const { 938 954 if ( ! error.empty() ) throw SemanticError( error + " in declaration of ", this ); 939 940 if ( variable.name ) {941 static const TypeDecl::Kind kindMap[] = { TypeDecl::Any, TypeDecl::Ftype, TypeDecl::Dtype };942 TypeDecl * ret = new TypeDecl( *variable.name, DeclarationNode::NoStorageClass, nullptr, kindMap[ variable.tyClass ] );943 buildList( variable.assertions, ret->get_assertions() );944 return ret;945 } // if946 947 955 if ( type ) { 948 return buildDecl( type, name ? *name : string( "" ), storageClass, maybeBuild< Expression >( bitfieldWidth ), isInline, isNoreturn, linkage, maybeBuild< Initializer >(initializer) )->set_extension( extension ); 949 } // if 950 956 if ( type->kind == TypeData::Variable ) { 957 static const TypeDecl::Kind kindMap[] = { TypeDecl::Any, TypeDecl::Ftype, TypeDecl::Dtype }; 958 TypeDecl * ret = new TypeDecl( variable.name, DeclarationNode::NoStorageClass, 0, kindMap[ variable.tyClass ] ); 959 buildList( variable.assertions, ret->get_assertions() ); 960 return ret; 961 } else { 962 return buildDecl( type, name, storageClass, maybeBuild< Expression >( bitfieldWidth ), isInline, isNoreturn, linkage, maybeBuild< Initializer >(initializer) )->set_extension( extension ); 963 } // if 964 } // if 951 965 if ( ! isInline && ! isNoreturn ) { 952 assertf( name, "ObjectDecl are assumed to have names\n" ); 953 return (new ObjectDecl( *name, storageClass, linkage, maybeBuild< Expression >( bitfieldWidth ), nullptr, maybeBuild< Initializer >( initializer ) ))->set_extension( extension ); 954 } // if 955 966 return (new ObjectDecl( name, storageClass, linkage, maybeBuild< Expression >( bitfieldWidth ), 0, maybeBuild< Initializer >( initializer ) ))->set_extension( extension ); 967 } // if 956 968 throw SemanticError( "invalid function specifier ", this ); 957 969 } 958 970 959 Type * DeclarationNode::buildType() const {971 Type *DeclarationNode::buildType() const { 960 972 assert( type ); 961 962 if ( attr.name ) {963 AttrType * ret;964 if ( attr.expr ) {965 ret = new AttrType( buildQualifiers( type ), *attr.name, attr.expr->build() );966 } else {967 assert( attr.type );968 ret = new AttrType( buildQualifiers( type ), *attr.name, attr.type->buildType() );969 } // if970 return ret;971 } // if972 973 973 974 switch ( type->kind ) { 974 975 case TypeData::Enum: 975 return new EnumInstType( buildQualifiers( type ), *type->enumeration.name );976 return new EnumInstType( buildQualifiers( type ), type->enumeration.name ); 976 977 case TypeData::Aggregate: { 977 ReferenceToType * ret;978 ReferenceToType *ret; 978 979 switch ( type->aggregate.kind ) { 979 980 case DeclarationNode::Struct: 980 ret = new StructInstType( buildQualifiers( type ), *type->aggregate.name );981 ret = new StructInstType( buildQualifiers( type ), type->aggregate.name ); 981 982 break; 982 983 case DeclarationNode::Union: 983 ret = new UnionInstType( buildQualifiers( type ), *type->aggregate.name );984 ret = new UnionInstType( buildQualifiers( type ), type->aggregate.name ); 984 985 break; 985 986 case DeclarationNode::Trait: 986 ret = new TraitInstType( buildQualifiers( type ), *type->aggregate.name );987 ret = new TraitInstType( buildQualifiers( type ), type->aggregate.name ); 987 988 break; 988 989 default: … … 993 994 } 994 995 case TypeData::Symbolic: { 995 TypeInstType * ret = new TypeInstType( buildQualifiers( type ), *type->symbolic.name, false );996 TypeInstType *ret = new TypeInstType( buildQualifiers( type ), type->symbolic.name, false ); 996 997 buildList( type->symbolic.actuals, ret->get_parameters() ); 998 return ret; 999 } 1000 case TypeData::Attr: { 1001 assert( type->kind == TypeData::Attr ); 1002 // assert( type->attr ); 1003 AttrType * ret; 1004 if ( attr.expr ) { 1005 ret = new AttrType( buildQualifiers( type ), attr.name, attr.expr->build() ); 1006 } else { 1007 assert( attr.type ); 1008 ret = new AttrType( buildQualifiers( type ), attr.name, attr.type->buildType() ); 1009 } // if 997 1010 return ret; 998 1011 } -
src/Parser/ExpressionNode.cc
raee7e35 r7b69174 10 10 // Created On : Sat May 16 13:17:07 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Fri Sep 16 16:27:44201613 // Update Count : 50 812 // Last Modified On : Thu Aug 25 21:39:40 2016 13 // Update Count : 503 14 14 // 15 15 … … 31 31 32 32 using namespace std; 33 34 ExpressionNode::ExpressionNode( const ExpressionNode &other ) : ParseNode( other.get_name() ), extension( other.extension ) {} 33 35 34 36 //############################################################################## -
src/Parser/ParseNode.h
raee7e35 r7b69174 10 10 // Created On : Sat May 16 13:28:16 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Sat Sep 24 11:12:04201613 // Update Count : 6 3312 // Last Modified On : Mon Sep 12 08:00:05 2016 13 // Update Count : 603 14 14 // 15 15 … … 41 41 public: 42 42 ParseNode() {}; 43 virtual ~ParseNode() { delete next; delete name; }; 43 ParseNode( const std::string * name ) : name( * name ) { assert( false ); delete name; } 44 ParseNode( const std::string &name ) : name( name ) { assert( false ); } 45 virtual ~ParseNode() { delete next; }; 44 46 virtual ParseNode * clone() const = 0; 45 47 46 48 ParseNode * get_next() const { return next; } 47 49 ParseNode * set_next( ParseNode * newlink ) { next = newlink; return this; } 48 49 50 ParseNode * get_last() { 50 51 ParseNode * current; 51 for ( current = this; current->get_next() != nullptr; current = current->get_next() );52 for ( current = this; current->get_next() != 0; current = current->get_next() ); 52 53 return current; 53 54 } 54 55 ParseNode * set_last( ParseNode * newlast ) { 55 if ( newlast != nullptr) get_last()->set_next( newlast );56 if ( newlast != 0 ) get_last()->set_next( newlast ); 56 57 return this; 57 58 } 59 60 const std::string &get_name() const { return name; } 61 void set_name( const std::string &newValue ) { name = newValue; } 58 62 59 63 virtual void print( std::ostream &os, int indent = 0 ) const {} 60 64 virtual void printList( std::ostream &os, int indent = 0 ) const {} 61 65 private: 62 66 static int indent_by; 63 67 64 68 ParseNode * next = nullptr; 65 std::string * name = nullptr;69 std::string name; 66 70 }; // ParseNode 67 71 … … 70 74 class InitializerNode : public ParseNode { 71 75 public: 72 InitializerNode( ExpressionNode *, bool aggrp = false, ExpressionNode * des = nullptr);73 InitializerNode( InitializerNode *, bool aggrp = false, ExpressionNode * des = nullptr);76 InitializerNode( ExpressionNode *, bool aggrp = false, ExpressionNode * des = 0 ); 77 InitializerNode( InitializerNode *, bool aggrp = false, ExpressionNode * des = 0 ); 74 78 ~InitializerNode(); 75 79 virtual InitializerNode * clone() const { assert( false ); return nullptr; } … … 102 106 public: 103 107 ExpressionNode( Expression * expr = nullptr ) : expr( expr ) {} 108 ExpressionNode( Expression * expr, const std::string * name ) : ParseNode( name ), expr( expr ) {} 104 109 ExpressionNode( const ExpressionNode &other ); 105 110 virtual ~ExpressionNode() {} … … 178 183 Expression * build_attrexpr( NameExpr * var, ExpressionNode * expr_node ); 179 184 Expression * build_attrtype( NameExpr * var, DeclarationNode * decl_node ); 180 Expression * build_tuple( ExpressionNode * expr_node = nullptr);185 Expression * build_tuple( ExpressionNode * expr_node = 0 ); 181 186 Expression * build_func( ExpressionNode * function, ExpressionNode * expr_node ); 182 187 Expression * build_range( ExpressionNode * low, ExpressionNode * high ); … … 214 219 static DeclarationNode * newFunction( std::string * name, DeclarationNode * ret, DeclarationNode * param, StatementNode * body, bool newStyle = false ); 215 220 static DeclarationNode * newQualifier( Qualifier ); 216 static DeclarationNode * newForall( DeclarationNode * );221 static DeclarationNode * newForall( DeclarationNode *); 217 222 static DeclarationNode * newStorageClass( StorageClass ); 218 223 static DeclarationNode * newBasicType( BasicType ); … … 221 226 static DeclarationNode * newLength( Length lnth ); 222 227 static DeclarationNode * newBuiltinType( BuiltinType ); 223 static DeclarationNode * newFromTypedef( std::string * );228 static DeclarationNode * newFromTypedef( std::string *); 224 229 static DeclarationNode * newAggregate( Aggregate kind, const std::string * name, ExpressionNode * actuals, DeclarationNode * fields, bool body ); 225 230 static DeclarationNode * newEnum( std::string * name, DeclarationNode * constants ); 226 231 static DeclarationNode * newEnumConstant( std::string * name, ExpressionNode * constant ); 227 static DeclarationNode * newName( std::string * );232 static DeclarationNode * newName( std::string *); 228 233 static DeclarationNode * newFromTypeGen( std::string *, ExpressionNode * params ); 229 static DeclarationNode * newTypeParam( TypeClass, std::string * );230 static DeclarationNode * newTrait( conststd::string * name, DeclarationNode * params, DeclarationNode * asserts );231 static DeclarationNode * newTraitUse( conststd::string * name, ExpressionNode * params );234 static DeclarationNode * newTypeParam( TypeClass, std::string *); 235 static DeclarationNode * newTrait( std::string * name, DeclarationNode * params, DeclarationNode * asserts ); 236 static DeclarationNode * newTraitUse( std::string * name, ExpressionNode * params ); 232 237 static DeclarationNode * newTypeDecl( std::string * name, DeclarationNode * typeParams ); 233 238 static DeclarationNode * newPointer( DeclarationNode * qualifiers ); … … 244 249 DeclarationNode * clone() const; 245 250 246 DeclarationNode * addQualifiers( DeclarationNode * );251 DeclarationNode * addQualifiers( DeclarationNode *); 247 252 void checkQualifiers( const TypeData *, const TypeData * ); 248 void checkStorageClasses( DeclarationNode * );249 DeclarationNode * copyStorageClasses( DeclarationNode * );250 DeclarationNode * addType( DeclarationNode * );253 void checkStorageClasses( DeclarationNode *q ); 254 DeclarationNode * copyStorageClasses( DeclarationNode *); 255 DeclarationNode * addType( DeclarationNode *); 251 256 DeclarationNode * addTypedef(); 252 DeclarationNode * addAssertions( DeclarationNode * );253 DeclarationNode * addName( std::string * );257 DeclarationNode * addAssertions( DeclarationNode *); 258 DeclarationNode * addName( std::string *); 254 259 DeclarationNode * addBitfield( ExpressionNode * size ); 255 260 DeclarationNode * addVarArgs(); … … 265 270 266 271 DeclarationNode * cloneType( std::string * newName ); 272 DeclarationNode * cloneType( DeclarationNode * existing ); 273 DeclarationNode * cloneType( int ) { return cloneType( ( std::string *)0 ); } 274 DeclarationNode * cloneBaseType( std::string * newName ); 267 275 DeclarationNode * cloneBaseType( DeclarationNode * newdecl ); 268 276 … … 278 286 279 287 bool get_hasEllipsis() const; 288 const std::string &get_name() const { return name; } 280 289 LinkageSpec::Spec get_linkage() const { return linkage; } 281 290 DeclarationNode * extractAggregate() const; … … 286 295 DeclarationNode * set_extension( bool exten ) { extension = exten; return this; } 287 296 public: 297 // StorageClass buildStorageClass() const; 298 // bool buildFuncSpecifier( StorageClass key ) const; 299 288 300 struct Variable_t { 289 const std::string * name;290 301 DeclarationNode::TypeClass tyClass; 302 std::string name; 291 303 DeclarationNode * assertions; 292 304 }; … … 294 306 295 307 struct Attr_t { 296 const std::string *name;308 std::string name; 297 309 ExpressionNode * expr; 298 310 DeclarationNode * type; … … 303 315 304 316 TypeData * type; 317 std::string name; 305 318 StorageClass storageClass; 306 319 bool isInline, isNoreturn; … … 318 331 319 332 Type * buildType( TypeData * type ); 333 //Type::Qualifiers buildQualifiers( const TypeData::Qualifiers & qualifiers ); 320 334 321 335 static inline Type * maybeMoveBuildType( const DeclarationNode * orig ) { … … 379 393 Statement * build_finally( StatementNode * stmt ); 380 394 Statement * build_compound( StatementNode * first ); 381 Statement * build_asmstmt( bool voltile, ConstantExpr * instruction, ExpressionNode * output = nullptr, ExpressionNode * input = nullptr, ExpressionNode * clobber = nullptr, LabelNode * gotolabels = nullptr);395 Statement * build_asmstmt( bool voltile, ConstantExpr * instruction, ExpressionNode * output = 0, ExpressionNode * input = 0, ExpressionNode * clobber = 0, LabelNode * gotolabels = 0 ); 382 396 383 397 //############################################################################## -
src/Parser/TypeData.cc
raee7e35 r7b69174 10 10 // Created On : Sat May 16 15:12:51 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Sat Sep 24 11:14:26201613 // Update Count : 41512 // Last Modified On : Mon Sep 12 21:11:22 2016 13 // Update Count : 377 14 14 // 15 15 … … 24 24 #include "SynTree/Statement.h" 25 25 #include "SynTree/Initializer.h" 26 using namespace std; 27 28 TypeData::TypeData( Kind k ) : kind( k ), base( nullptr ), forall( nullptr ) { 26 27 TypeData::TypeData( Kind k ) : kind( k ), base( 0 ), forall( 0 ) { 29 28 switch ( kind ) { 30 29 case Unknown: … … 38 37 case Array: 39 38 // array = new Array_t; 40 array.dimension = nullptr;39 array.dimension = 0; 41 40 array.isVarLen = false; 42 41 array.isStatic = false; … … 44 43 case Function: 45 44 // function = new Function_t; 46 function.params = nullptr;47 function.idList = nullptr;48 function.oldDeclList = nullptr;49 function.body = nullptr;45 function.params = 0; 46 function.idList = 0; 47 function.oldDeclList = 0; 48 function.body = 0; 50 49 function.hasBody = false; 51 50 function.newStyle = false; … … 53 52 case Aggregate: 54 53 // aggregate = new Aggregate_t; 55 aggregate.name = nullptr; 56 aggregate.params = nullptr; 57 aggregate.actuals = nullptr; 58 aggregate.fields = nullptr; 54 aggregate.params = 0; 55 aggregate.actuals = 0; 56 aggregate.fields = 0; 59 57 break; 60 58 case AggregateInst: 61 59 // aggInst = new AggInst_t; 62 aggInst.aggregate = nullptr;63 aggInst.params = nullptr;60 aggInst.aggregate = 0; 61 aggInst.params = 0; 64 62 break; 65 63 case Enum: 66 64 // enumeration = new Enumeration_t; 67 enumeration.name = nullptr; 68 enumeration.constants = nullptr; 65 enumeration.constants = 0; 69 66 break; 70 67 case Symbolic: 71 68 case SymbolicInst: 72 69 // symbolic = new Symbolic_t; 73 symbolic.name = nullptr; 74 symbolic.params = nullptr; 75 symbolic.actuals = nullptr; 76 symbolic.assertions = nullptr; 70 symbolic.params = 0; 71 symbolic.actuals = 0; 72 symbolic.assertions = 0; 73 break; 74 case Variable: 75 // variable = new Variable_t; 76 // variable.tyClass = DeclarationNode::Type; 77 // variable.assertions = 0; 77 78 break; 78 79 case Tuple: … … 83 84 // typeexpr = new Typeof_t; 84 85 typeexpr = nullptr; 86 break; 87 case Attr: 88 // attr = new Attr_t; 89 // attr.expr = nullptr; 90 // attr.type = nullptr; 85 91 break; 86 92 case Builtin: … … 115 121 break; 116 122 case Aggregate: 117 delete aggregate.name;118 123 delete aggregate.params; 119 124 delete aggregate.actuals; … … 127 132 break; 128 133 case Enum: 129 delete enumeration.name;130 134 delete enumeration.constants; 131 135 // delete enumeration; … … 133 137 case Symbolic: 134 138 case SymbolicInst: 135 delete symbolic.name;136 139 delete symbolic.params; 137 140 delete symbolic.actuals; … … 139 142 // delete symbolic; 140 143 break; 144 case Variable: 145 // delete variable.assertions; 146 // delete variable; 147 break; 141 148 case Tuple: 142 149 // delete tuple->members; … … 146 153 // delete typeexpr->expr; 147 154 delete typeexpr; 155 break; 156 case Attr: 157 // delete attr.expr; 158 // delete attr.type; 159 // delete attr; 148 160 break; 149 161 case Builtin: … … 185 197 break; 186 198 case Aggregate: 187 newtype->aggregate.name = aggregate.name ? new string( *aggregate.name ) : nullptr;188 199 newtype->aggregate.params = maybeClone( aggregate.params ); 189 200 newtype->aggregate.actuals = maybeClone( aggregate.actuals ); 190 201 newtype->aggregate.fields = maybeClone( aggregate.fields ); 202 newtype->aggregate.name = aggregate.name; 191 203 newtype->aggregate.kind = aggregate.kind; 192 204 newtype->aggregate.body = aggregate.body; … … 197 209 break; 198 210 case Enum: 199 newtype->enumeration.name = enumeration.name ? new string( *enumeration.name ) : nullptr;211 newtype->enumeration.name = enumeration.name; 200 212 newtype->enumeration.constants = maybeClone( enumeration.constants ); 201 213 break; 202 214 case Symbolic: 203 215 case SymbolicInst: 204 newtype->symbolic.name = symbolic.name ? new string( *symbolic.name ) : nullptr;205 216 newtype->symbolic.params = maybeClone( symbolic.params ); 206 217 newtype->symbolic.actuals = maybeClone( symbolic.actuals ); 207 218 newtype->symbolic.assertions = maybeClone( symbolic.assertions ); 208 219 newtype->symbolic.isTypedef = symbolic.isTypedef; 220 newtype->symbolic.name = symbolic.name; 221 break; 222 case Variable: 223 assert( false ); 224 // newtype->variable.assertions = maybeClone( variable.assertions ); 225 // newtype->variable.name = variable.name; 226 // newtype->variable.tyClass = variable.tyClass; 209 227 break; 210 228 case Tuple: … … 213 231 case Typeof: 214 232 newtype->typeexpr = maybeClone( typeexpr ); 233 break; 234 case Attr: 235 assert( false ); 236 // newtype->attr.expr = maybeClone( attr.expr ); 237 // newtype->attr.type = maybeClone( attr.type ); 215 238 break; 216 239 case Builtin: … … 222 245 } // TypeData::clone 223 246 224 void TypeData::print( ostream &os, int indent ) const { 247 void TypeData::print( std::ostream &os, int indent ) const { 248 using std::endl; 249 using std::string; 250 225 251 for ( int i = 0; i < DeclarationNode::NoQualifier; i += 1 ) { 226 252 if ( qualifiers[i] ) os << DeclarationNode::qualifierName[ i ] << ' '; … … 300 326 break; 301 327 case Aggregate: 302 os << DeclarationNode::aggregateName[ aggregate.kind ] << ' ' << *aggregate.name << endl;328 os << DeclarationNode::aggregateName[ aggregate.kind ] << ' ' << aggregate.name << endl; 303 329 if ( aggregate.params ) { 304 330 os << string( indent + 2, ' ' ) << "with type parameters " << endl; … … 337 363 break; 338 364 case SymbolicInst: 339 os << "instance of type " << *symbolic.name;365 os << "instance of type " << symbolic.name; 340 366 if ( symbolic.actuals ) { 341 367 os << " with parameters" << endl; … … 363 389 } // if 364 390 break; 391 case Variable: 392 // os << DeclarationNode::typeClassName[ variable.tyClass ] << " variable "; 393 // if ( variable.assertions ) { 394 // os << endl << string( indent + 2, ' ' ) << "with assertions" << endl; 395 // variable.assertions->printList( os, indent + 4 ); 396 // os << string( indent + 2, ' ' ); 397 // } // if 398 break; 365 399 case Tuple: 366 400 os << "tuple "; … … 376 410 } // if 377 411 break; 412 case Attr: 413 // os << "attribute type decl " << attr.name << " applied to "; 414 // if ( attr.expr ) { 415 // attr.expr->print( os, indent + 2 ); 416 // } // if 417 // if ( attr.type ) { 418 // attr.type->print( os, indent + 2 ); 419 // } // if 420 break; 378 421 case Builtin: 379 422 os << "gcc builtin type"; … … 385 428 } // TypeData::print 386 429 387 void buildForall( const DeclarationNode * firstNode, list< TypeDecl* > &outputList ) {430 void buildForall( const DeclarationNode * firstNode, std::list< TypeDecl* > &outputList ) { 388 431 buildList( firstNode, outputList ); 389 for ( list< TypeDecl* >::iterator i = outputList.begin(); i != outputList.end(); ++i ) {432 for ( std::list< TypeDecl* >::iterator i = outputList.begin(); i != outputList.end(); ++i ) { 390 433 if ( (*i)->get_kind() == TypeDecl::Any ) { 391 434 // add assertion parameters to `type' tyvars in reverse order 392 435 // add dtor: void ^?{}(T *) 393 436 FunctionType * dtorType = new FunctionType( Type::Qualifiers(), false ); 394 dtorType->get_parameters().push_back( new ObjectDecl( "", DeclarationNode::NoStorageClass, LinkageSpec::Cforall, nullptr, new PointerType( Type::Qualifiers(), new TypeInstType( Type::Qualifiers(), (*i)->get_name(), *i ) ), nullptr) );395 (*i)->get_assertions().push_front( new FunctionDecl( "^?{}", DeclarationNode::NoStorageClass, LinkageSpec::Cforall, dtorType, nullptr, false, false ) );437 dtorType->get_parameters().push_back( new ObjectDecl( "", DeclarationNode::NoStorageClass, LinkageSpec::Cforall, 0, new PointerType( Type::Qualifiers(), new TypeInstType( Type::Qualifiers(), (*i)->get_name(), *i ) ), 0 ) ); 438 (*i)->get_assertions().push_front( new FunctionDecl( "^?{}", DeclarationNode::NoStorageClass, LinkageSpec::Cforall, dtorType, 0, false, false ) ); 396 439 397 440 // add copy ctor: void ?{}(T *, T) 398 441 FunctionType * copyCtorType = new FunctionType( Type::Qualifiers(), false ); 399 copyCtorType->get_parameters().push_back( new ObjectDecl( "", DeclarationNode::NoStorageClass, LinkageSpec::Cforall, nullptr, new PointerType( Type::Qualifiers(), new TypeInstType( Type::Qualifiers(), (*i)->get_name(), *i ) ), nullptr) );400 copyCtorType->get_parameters().push_back( new ObjectDecl( "", DeclarationNode::NoStorageClass, LinkageSpec::Cforall, nullptr, new TypeInstType( Type::Qualifiers(), (*i)->get_name(), *i ), nullptr) );401 (*i)->get_assertions().push_front( new FunctionDecl( "?{}", DeclarationNode::NoStorageClass, LinkageSpec::Cforall, copyCtorType, nullptr, false, false ) );442 copyCtorType->get_parameters().push_back( new ObjectDecl( "", DeclarationNode::NoStorageClass, LinkageSpec::Cforall, 0, new PointerType( Type::Qualifiers(), new TypeInstType( Type::Qualifiers(), (*i)->get_name(), *i ) ), 0 ) ); 443 copyCtorType->get_parameters().push_back( new ObjectDecl( "", DeclarationNode::NoStorageClass, LinkageSpec::Cforall, 0, new TypeInstType( Type::Qualifiers(), (*i)->get_name(), *i ), 0 ) ); 444 (*i)->get_assertions().push_front( new FunctionDecl( "?{}", DeclarationNode::NoStorageClass, LinkageSpec::Cforall, copyCtorType, 0, false, false ) ); 402 445 403 446 // add default ctor: void ?{}(T *) 404 447 FunctionType * ctorType = new FunctionType( Type::Qualifiers(), false ); 405 ctorType->get_parameters().push_back( new ObjectDecl( "", DeclarationNode::NoStorageClass, LinkageSpec::Cforall, nullptr, new PointerType( Type::Qualifiers(), new TypeInstType( Type::Qualifiers(), (*i)->get_name(), *i ) ), nullptr) );406 (*i)->get_assertions().push_front( new FunctionDecl( "?{}", DeclarationNode::NoStorageClass, LinkageSpec::Cforall, ctorType, nullptr, false, false ) );448 ctorType->get_parameters().push_back( new ObjectDecl( "", DeclarationNode::NoStorageClass, LinkageSpec::Cforall, 0, new PointerType( Type::Qualifiers(), new TypeInstType( Type::Qualifiers(), (*i)->get_name(), *i ) ), 0 ) ); 449 (*i)->get_assertions().push_front( new FunctionDecl( "?{}", DeclarationNode::NoStorageClass, LinkageSpec::Cforall, ctorType, 0, false, false ) ); 407 450 408 451 // add assignment operator: T * ?=?(T *, T) 409 452 FunctionType * assignType = new FunctionType( Type::Qualifiers(), false ); 410 assignType->get_parameters().push_back( new ObjectDecl( "", DeclarationNode::NoStorageClass, LinkageSpec::Cforall, nullptr, new PointerType( Type::Qualifiers(), new TypeInstType( Type::Qualifiers(), (*i)->get_name(), *i ) ), nullptr) );411 assignType->get_parameters().push_back( new ObjectDecl( "", DeclarationNode::NoStorageClass, LinkageSpec::Cforall, nullptr, new TypeInstType( Type::Qualifiers(), (*i)->get_name(), *i ), nullptr) );412 assignType->get_returnVals().push_back( new ObjectDecl( "", DeclarationNode::NoStorageClass, LinkageSpec::Cforall, nullptr, new TypeInstType( Type::Qualifiers(), (*i)->get_name(), *i ), nullptr) );413 (*i)->get_assertions().push_front( new FunctionDecl( "?=?", DeclarationNode::NoStorageClass, LinkageSpec::Cforall, assignType, nullptr, false, false ) );453 assignType->get_parameters().push_back( new ObjectDecl( "", DeclarationNode::NoStorageClass, LinkageSpec::Cforall, 0, new PointerType( Type::Qualifiers(), new TypeInstType( Type::Qualifiers(), (*i)->get_name(), *i ) ), 0 ) ); 454 assignType->get_parameters().push_back( new ObjectDecl( "", DeclarationNode::NoStorageClass, LinkageSpec::Cforall, 0, new TypeInstType( Type::Qualifiers(), (*i)->get_name(), *i ), 0 ) ); 455 assignType->get_returnVals().push_back( new ObjectDecl( "", DeclarationNode::NoStorageClass, LinkageSpec::Cforall, 0, new TypeInstType( Type::Qualifiers(), (*i)->get_name(), *i ), 0 ) ); 456 (*i)->get_assertions().push_front( new FunctionDecl( "?=?", DeclarationNode::NoStorageClass, LinkageSpec::Cforall, assignType, 0, false, false ) ); 414 457 } // if 415 458 } // for … … 443 486 case TypeData::Builtin: 444 487 return new VarArgsType( buildQualifiers( td ) ); 488 case TypeData::Attr: 489 assert( false ); 490 return buildAttr( td ); 445 491 case TypeData::Symbolic: 446 492 case TypeData::Enum: 447 493 case TypeData::Aggregate: 494 case TypeData::Variable: 448 495 assert( false ); 449 496 } // switch 450 return nullptr;497 return 0; 451 498 } // typebuild 452 499 453 500 TypeData * typeextractAggregate( const TypeData * td, bool toplevel ) { 454 TypeData * ret = nullptr;501 TypeData * ret = 0; 455 502 456 503 switch ( td->kind ) { … … 502 549 case DeclarationNode::Bool: 503 550 if ( td->signedness != DeclarationNode::NoSignedness ) { 504 throw SemanticError( st ring( "invalid type specifier " ) + DeclarationNode::signednessName[ td->signedness ] + " in type: ", td );551 throw SemanticError( std::string( "invalid type specifier " ) + DeclarationNode::signednessName[ td->signedness ] + " in type: ", td ); 505 552 } // if 506 553 if ( td->length != DeclarationNode::NoLength ) { 507 throw SemanticError( st ring( "invalid type specifier " ) + DeclarationNode::lengthName[ td->length ] + " in type: ", td );554 throw SemanticError( std::string( "invalid type specifier " ) + DeclarationNode::lengthName[ td->length ] + " in type: ", td ); 508 555 } // if 509 556 … … 518 565 519 566 if ( td->length != DeclarationNode::NoLength ) { 520 throw SemanticError( st ring( "invalid type specifier " ) + DeclarationNode::lengthName[ td->length ] + " in type: ", td );567 throw SemanticError( std::string( "invalid type specifier " ) + DeclarationNode::lengthName[ td->length ] + " in type: ", td ); 521 568 } // if 522 569 … … 548 595 FloatingPoint: ; 549 596 if ( td->signedness != DeclarationNode::NoSignedness ) { 550 throw SemanticError( st ring( "invalid type specifier " ) + DeclarationNode::signednessName[ td->signedness ] + " in type: ", td );597 throw SemanticError( std::string( "invalid type specifier " ) + DeclarationNode::signednessName[ td->signedness ] + " in type: ", td ); 551 598 } // if 552 599 if ( td->length == DeclarationNode::Short || td->length == DeclarationNode::LongLong ) { 553 throw SemanticError( st ring( "invalid type specifier " ) + DeclarationNode::lengthName[ td->length ] + " in type: ", td );600 throw SemanticError( std::string( "invalid type specifier " ) + DeclarationNode::lengthName[ td->length ] + " in type: ", td ); 554 601 } // if 555 602 if ( td->basictype == DeclarationNode::Float && td->length == DeclarationNode::Long ) { … … 608 655 switch ( td->aggregate.kind ) { 609 656 case DeclarationNode::Struct: 610 at = new StructDecl( *td->aggregate.name );657 at = new StructDecl( td->aggregate.name ); 611 658 buildForall( td->aggregate.params, at->get_parameters() ); 612 659 break; 613 660 case DeclarationNode::Union: 614 at = new UnionDecl( *td->aggregate.name );661 at = new UnionDecl( td->aggregate.name ); 615 662 buildForall( td->aggregate.params, at->get_parameters() ); 616 663 break; 617 664 case DeclarationNode::Trait: 618 at = new TraitDecl( *td->aggregate.name );665 at = new TraitDecl( td->aggregate.name ); 619 666 buildList( td->aggregate.params, at->get_parameters() ); 620 667 break; … … 634 681 ReferenceToType * ret; 635 682 if ( td->aggInst.aggregate->kind == TypeData::Enum ) { 636 ret = new EnumInstType( buildQualifiers( td ), *td->aggInst.aggregate->enumeration.name );683 ret = new EnumInstType( buildQualifiers( td ), td->aggInst.aggregate->enumeration.name ); 637 684 } else { 638 685 assert( td->aggInst.aggregate->kind == TypeData::Aggregate ); 639 686 switch ( td->aggInst.aggregate->aggregate.kind ) { 640 687 case DeclarationNode::Struct: 641 assert( td->aggInst.aggregate->aggregate.name ); 642 ret = new StructInstType( buildQualifiers( td ), *td->aggInst.aggregate->aggregate.name ); 688 ret = new StructInstType( buildQualifiers( td ), td->aggInst.aggregate->aggregate.name ); 643 689 break; 644 690 case DeclarationNode::Union: 645 ret = new UnionInstType( buildQualifiers( td ), *td->aggInst.aggregate->aggregate.name );691 ret = new UnionInstType( buildQualifiers( td ), td->aggInst.aggregate->aggregate.name ); 646 692 break; 647 693 case DeclarationNode::Trait: 648 ret = new TraitInstType( buildQualifiers( td ), *td->aggInst.aggregate->aggregate.name );694 ret = new TraitInstType( buildQualifiers( td ), td->aggInst.aggregate->aggregate.name ); 649 695 break; 650 696 default: … … 657 703 } // buildAggInst 658 704 659 NamedTypeDecl * buildSymbolic( const TypeData * td, const st ring & name, DeclarationNode::StorageClass sc ) {705 NamedTypeDecl * buildSymbolic( const TypeData * td, const std::string & name, DeclarationNode::StorageClass sc ) { 660 706 assert( td->kind == TypeData::Symbolic ); 661 707 NamedTypeDecl * ret; … … 671 717 } // buildSymbolic 672 718 719 TypeDecl * buildVariable( const TypeData * td ) { 720 assert( false ); 721 return nullptr; 722 // assert( td->kind == TypeData::Variable ); 723 // static const TypeDecl::Kind kindMap[] = { TypeDecl::Any, TypeDecl::Ftype, TypeDecl::Dtype }; 724 725 // TypeDecl * ret = new TypeDecl( td->variable.name, DeclarationNode::NoStorageClass, 0, kindMap[ td->variable.tyClass ] ); 726 // buildList( td->variable.assertions, ret->get_assertions() ); 727 // return ret; 728 } // buildSymbolic 729 673 730 EnumDecl * buildEnum( const TypeData * td ) { 674 731 assert( td->kind == TypeData::Enum ); 675 EnumDecl * ret = new EnumDecl( *td->enumeration.name );732 EnumDecl * ret = new EnumDecl( td->enumeration.name ); 676 733 buildList( td->enumeration.constants, ret->get_members() ); 677 list< Declaration * >::iterator members = ret->get_members().begin();734 std::list< Declaration * >::iterator members = ret->get_members().begin(); 678 735 for ( const DeclarationNode * cur = td->enumeration. constants; cur != nullptr; cur = dynamic_cast< DeclarationNode * >( cur->get_next() ), ++members ) { 679 736 if ( cur->has_enumeratorValue() ) { 680 737 ObjectDecl * member = dynamic_cast< ObjectDecl * >(* members); 681 member->set_init( new SingleInit( maybeMoveBuild< Expression >( cur->consume_enumeratorValue() ), list< Expression * >() ) );738 member->set_init( new SingleInit( maybeMoveBuild< Expression >( cur->consume_enumeratorValue() ), std::list< Expression * >() ) ); 682 739 } // if 683 740 } // for … … 687 744 TypeInstType * buildSymbolicInst( const TypeData * td ) { 688 745 assert( td->kind == TypeData::SymbolicInst ); 689 TypeInstType * ret = new TypeInstType( buildQualifiers( td ), *td->symbolic.name, false );746 TypeInstType * ret = new TypeInstType( buildQualifiers( td ), td->symbolic.name, false ); 690 747 buildList( td->symbolic.actuals, ret->get_parameters() ); 691 748 buildForall( td->forall, ret->get_forall() ); … … 708 765 } // buildTypeof 709 766 710 Declaration * buildDecl( const TypeData * td, const string &name, DeclarationNode::StorageClass sc, Expression * bitfieldWidth, bool isInline, bool isNoreturn, LinkageSpec::Spec linkage, Initializer * init ) { 767 AttrType * buildAttr( const TypeData * td ) { 768 assert( false ); 769 return nullptr; 770 // assert( td->kind == TypeData::Attr ); 771 // // assert( td->attr ); 772 // AttrType * ret; 773 // if ( td->attr.expr ) { 774 // ret = new AttrType( buildQualifiers( td ), td->attr.name, td->attr.expr->build() ); 775 // } else { 776 // assert( td->attr.type ); 777 // ret = new AttrType( buildQualifiers( td ), td->attr.name, td->attr.type->buildType() ); 778 // } // if 779 // return ret; 780 } // buildAttr 781 782 Declaration * buildDecl( const TypeData * td, std::string name, DeclarationNode::StorageClass sc, Expression * bitfieldWidth, bool isInline, bool isNoreturn, LinkageSpec::Spec linkage, Initializer * init ) { 711 783 if ( td->kind == TypeData::Function ) { 712 784 FunctionDecl * decl; … … 718 790 decl = new FunctionDecl( name, sc, linkage, buildFunction( td ), body, isInline, isNoreturn ); 719 791 } else { 720 // list< Label > ls;721 decl = new FunctionDecl( name, sc, linkage, buildFunction( td ), new CompoundStmt( list< Label >() ), isInline, isNoreturn );792 // std::list< Label > ls; 793 decl = new FunctionDecl( name, sc, linkage, buildFunction( td ), new CompoundStmt( std::list< Label >() ), isInline, isNoreturn ); 722 794 } // if 723 795 } else { 724 decl = new FunctionDecl( name, sc, linkage, buildFunction( td ), nullptr, isInline, isNoreturn );725 } // if 726 for ( DeclarationNode * cur = td->function.idList; cur != nullptr; cur = dynamic_cast< DeclarationNode* >( cur->get_next() ) ) {727 if ( cur-> name) {728 decl->get_oldIdents().insert( decl->get_oldIdents().end(), *cur->name);796 decl = new FunctionDecl( name, sc, linkage, buildFunction( td ), 0, isInline, isNoreturn ); 797 } // if 798 for ( DeclarationNode * cur = td->function.idList; cur != 0; cur = dynamic_cast< DeclarationNode* >( cur->get_next() ) ) { 799 if ( cur->get_name() != "" ) { 800 decl->get_oldIdents().insert( decl->get_oldIdents().end(), cur->get_name() ); 729 801 } // if 730 802 } // for … … 737 809 } else if ( td->kind == TypeData::Symbolic ) { 738 810 return buildSymbolic( td, name, sc ); 811 } else if ( td->kind == TypeData::Variable ) { 812 assert( false ); 813 return buildVariable( td ); 739 814 } else { 740 return new ObjectDecl( name, sc, linkage, bitfieldWidth, typebuild( td ), init, list< Attribute * >(), isInline, isNoreturn );815 return new ObjectDecl( name, sc, linkage, bitfieldWidth, typebuild( td ), init, std::list< Attribute * >(), isInline, isNoreturn ); 741 816 } // if 742 return nullptr;817 return 0; 743 818 } // buildDecl 744 819 … … 756 831 break; 757 832 default: 758 ft->get_returnVals().push_back( dynamic_cast< DeclarationWithType* >( buildDecl( td->base, "", DeclarationNode::NoStorageClass, nullptr, false, false, LinkageSpec::Cforall ) ) );833 ft->get_returnVals().push_back( dynamic_cast< DeclarationWithType* >( buildDecl( td->base, "", DeclarationNode::NoStorageClass, 0, false, false, LinkageSpec::Cforall ) ) ); 759 834 } // switch 760 835 } else { 761 ft->get_returnVals().push_back( new ObjectDecl( "", DeclarationNode::NoStorageClass, LinkageSpec::Cforall, nullptr, new BasicType( Type::Qualifiers(), BasicType::SignedInt ), nullptr) );836 ft->get_returnVals().push_back( new ObjectDecl( "", DeclarationNode::NoStorageClass, LinkageSpec::Cforall, 0, new BasicType( Type::Qualifiers(), BasicType::SignedInt ), 0 ) ); 762 837 } // if 763 838 return ft; -
src/Parser/TypeData.h
raee7e35 r7b69174 10 10 // Created On : Sat May 16 15:18:36 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Sat Sep 24 11:10:38201613 // Update Count : 1 4112 // Last Modified On : Mon Sep 12 17:15:49 2016 13 // Update Count : 129 14 14 // 15 15 … … 24 24 struct TypeData { 25 25 enum Kind { Unknown, Basic, Pointer, Array, Function, Aggregate, AggregateInst, 26 Enum, EnumConstant, Symbolic, SymbolicInst, Tuple, Typeof, Builtin};26 Enum, EnumConstant, Symbolic, SymbolicInst, Variable, Tuple, Typeof, Builtin, Attr }; 27 27 28 28 struct Aggregate_t { 29 29 DeclarationNode::Aggregate kind; 30 const std::string *name;30 std::string name; 31 31 DeclarationNode * params; 32 ExpressionNode * actuals; // holds actual parameters later applied to AggInst32 ExpressionNode * actuals; // holds actual parameters later applied to AggInst 33 33 DeclarationNode * fields; 34 34 bool body; … … 47 47 48 48 struct Enumeration_t { 49 const std::string *name;49 std::string name; 50 50 DeclarationNode * constants; 51 51 }; … … 61 61 62 62 struct Symbolic_t { 63 const std::string *name;63 std::string name; 64 64 bool isTypedef; // false => TYPEGENname, true => TYPEDEFname 65 65 DeclarationNode * params; … … 88 88 DeclarationNode * tuple; 89 89 ExpressionNode * typeexpr; 90 // Attr_t attr; 90 91 // DeclarationNode::BuiltinType builtin; 91 92 … … 110 111 TupleType * buildTuple( const TypeData * ); 111 112 TypeofType * buildTypeof( const TypeData * ); 112 Declaration * buildDecl( const TypeData *, const std::string &, DeclarationNode::StorageClass, Expression *, bool isInline, bool isNoreturn, LinkageSpec::Spec, Initializer * init = nullptr ); 113 AttrType * buildAttr( const TypeData * ); 114 Declaration * buildDecl( const TypeData *, std::string, DeclarationNode::StorageClass, Expression *, bool isInline, bool isNoreturn, LinkageSpec::Spec, Initializer * init = 0 ); 113 115 FunctionType * buildFunction( const TypeData * ); 114 116 -
src/Parser/parser.cc
raee7e35 r7b69174 82 82 #include "TypeData.h" 83 83 #include "LinkageSpec.h" 84 using namespace std;85 84 86 85 extern DeclarationNode * parseTree; … … 88 87 extern TypedefTable typedefTable; 89 88 90 st ack< LinkageSpec::Spec > linkageStack;91 92 void appendStr( st ring *to,string *from ) {89 std::stack< LinkageSpec::Spec > linkageStack; 90 91 void appendStr( std::string *to, std::string *from ) { 93 92 // "abc" "def" "ghi" => "abcdefghi", remove new text from quotes and insert before last quote in old string. 94 93 to->insert( to->length() - 1, from->substr( 1, from->length() - 2 ) ); … … 97 96 98 97 /* Line 268 of yacc.c */ 99 #line 100"Parser/parser.cc"98 #line 99 "Parser/parser.cc" 100 99 101 100 /* Enabling traces. */ … … 348 347 349 348 /* Line 293 of yacc.c */ 350 #line 11 6"parser.yy"349 #line 115 "parser.yy" 351 350 352 351 Token tok; … … 368 367 369 368 /* Line 293 of yacc.c */ 370 #line 37 1"Parser/parser.cc"369 #line 370 "Parser/parser.cc" 371 370 } YYSTYPE; 372 371 # define YYSTYPE_IS_TRIVIAL 1 … … 380 379 381 380 /* Line 343 of yacc.c */ 382 #line 38 3"Parser/parser.cc"381 #line 382 "Parser/parser.cc" 383 382 384 383 #ifdef short … … 1022 1021 static const yytype_uint16 yyrline[] = 1023 1022 { 1024 0, 30 1, 301, 305, 312, 313, 314, 318, 319, 320,1025 32 4, 325, 329, 330, 334, 335, 339, 343, 344, 355,1026 35 7, 359, 361, 366, 367, 373, 377, 379, 380, 382,1027 38 3, 385, 387, 389, 398, 399, 405, 406, 410, 411,1028 41 5, 419, 421, 423, 425, 430, 433, 435, 437, 442,1029 45 5, 457, 459, 461, 463, 465, 467, 469, 471, 473,1030 47 5, 482, 483, 489, 490, 491, 492, 496, 497, 499,1031 50 4, 505, 507, 509, 514, 515, 517, 522, 523, 525,1032 5 30, 531, 533, 535, 537, 542, 543, 545, 550, 551,1033 55 6, 557, 562, 563, 568, 569, 574, 575, 580, 581,1034 58 4, 586, 591, 596, 597, 599, 605, 606, 610, 611,1035 61 2, 613, 614, 615, 616, 617, 618, 619, 620, 621,1036 62 7, 629, 631, 633, 638, 639, 644, 645, 651, 652,1037 65 8, 659, 660, 661, 662, 663, 664, 665, 666, 676,1038 68 3, 685, 695, 696, 701, 703, 709, 711, 715, 716,1039 72 1, 726, 729, 731, 733, 743, 745, 756, 757, 759,1040 76 3, 765, 769, 770, 775, 776, 780, 785, 786, 790,1041 79 2, 798, 799, 803, 805, 807, 809, 815, 816, 820,1042 82 2, 827, 829, 831, 836, 838, 843, 845, 849, 852,1043 85 6, 859, 863, 865, 867, 869, 874, 876, 878, 883,1044 88 5, 887, 889, 891, 896, 898, 900, 902, 907, 919,1045 9 20, 925, 927, 932, 936, 938, 940, 942, 944, 950,1046 95 1, 957, 958, 962, 963, 968, 970, 976, 977, 979,1047 98 4, 989, 999, 1001, 1005, 1006, 1011, 1013, 1017, 1018,1048 102 2, 1024, 1028, 1029, 1033, 1034, 1038, 1039, 1054, 1055,1049 105 6, 1057, 1058, 1062, 1067, 1074, 1084, 1089, 1094, 1102,1050 110 7, 1112, 1117, 1122, 1130, 1152, 1157, 1164, 1166, 1173,1051 117 8, 1183, 1194, 1199, 1204, 1209, 1214, 1223, 1228, 1236,1052 123 7, 1238, 1239, 1245, 1250, 1258, 1259, 1260, 1261, 1265,1053 126 6, 1267, 1268, 1273, 1274, 1283, 1284, 1289, 1290, 1295,1054 129 7, 1299, 1301, 1303, 1306, 1305, 1317, 1318, 1320, 1330,1055 133 1, 1336, 1338, 1340, 1342, 1344, 1347, 1349, 1352, 1357,1056 135 9, 1361, 1363, 1365, 1367, 1369, 1371, 1373, 1375, 1377,1057 137 9, 1381, 1387, 1388, 1390, 1392, 1394, 1399, 1400, 1406,1058 140 7, 1409, 1411, 1416, 1418, 1420, 1422, 1427, 1428, 1430,1059 143 2, 1437, 1438, 1440, 1445, 1446, 1448, 1450, 1455, 1457,1060 145 9, 1464, 1465, 1469, 1471, 1477, 1476, 1480, 1482, 1487,1061 148 9, 1495, 1496, 1501, 1502, 1504, 1505, 1514, 1515, 1517,1062 151 9, 1524, 1526, 1532, 1533, 1535, 1538, 1541, 1546, 1547,1063 155 2, 1557, 1561, 1563, 1569, 1568, 1575, 1577, 1583, 1584,1064 159 2, 1593, 1597, 1598, 1599, 1601, 1603, 1610, 1611, 1613,1065 161 5, 1620, 1621, 1627, 1628, 1632, 1633, 1638, 1639, 1640,1066 164 2, 1650, 1651, 1653, 1656, 1658, 1662, 1663, 1664, 1666,1067 166 8, 1672, 1677, 1685, 1686, 1695, 1697, 1702, 1703, 1704,1068 170 8, 1709, 1710, 1714, 1715, 1716, 1720, 1721, 1722, 1727,1069 172 8, 1729, 1730, 1736, 1737, 1739, 1744, 1745, 1750, 1751,1070 175 2, 1753, 1754, 1769, 1770, 1775, 1776, 1782, 1784, 1787,1071 178 9, 1791, 1814, 1815, 1817, 1819, 1824, 1825, 1827, 1832,1072 183 7, 1838, 1844, 1843, 1847, 1851, 1853, 1855, 1861, 1862,1073 186 7, 1872, 1874, 1879, 1881, 1882, 1884, 1889, 1891, 1893,1074 189 8, 1900, 1905, 1910, 1918, 1924, 1923, 1937, 1938, 1943,1075 194 4, 1948, 1953, 1958, 1966, 1971, 1982, 1983, 1988, 1989,1076 199 5, 1996, 2000, 2001, 2002, 2005, 2004, 2015, 2024, 2030,1077 203 6, 2045, 2051, 2057, 2063, 2069, 2077, 2083, 2091, 2097,1078 210 6, 2107, 2108, 2112, 2116, 2118, 2123, 2124, 2128, 2129,1079 213 4, 2140, 2141, 2144, 2146, 2147, 2151, 2152, 2153, 2154,1080 218 8, 2190, 2191, 2193, 2198, 2203, 2208, 2210, 2212, 2217,1081 221 9, 2221, 2223, 2228, 2230, 2239, 2241, 2242, 2247, 2249,1082 225 1, 2256, 2258, 2260, 2265, 2267, 2269, 2278, 2279, 2280,1083 228 4, 2286, 2288, 2293, 2295, 2297, 2302, 2304, 2306, 2321,1084 232 3, 2324, 2326, 2331, 2332, 2337, 2339, 2341, 2346, 2348,1085 23 50, 2352, 2357, 2359, 2361, 2371, 2373, 2374, 2376, 2381,1086 238 3, 2385, 2390, 2392, 2394, 2396, 2401, 2403, 2405, 2436,1087 243 8, 2439, 2441, 2446, 2451, 2459, 2461, 2463, 2468, 2470,1088 247 5, 2477, 2491, 2492, 2494, 2499, 2501, 2503, 2505, 2507,1089 251 2, 2513, 2515, 2517, 2522, 2524, 2526, 2532, 2534, 2536,1090 25 40, 2542, 2544, 2546, 2560, 2561, 2563, 2568, 2570, 2572,1091 257 4, 2576, 2581, 2582, 2584, 2586, 2591, 2593, 2595, 2601,1092 260 2, 2604, 2613, 2616, 2618, 2621, 2623, 2625, 2638, 2639,1093 264 1, 2646, 2648, 2650, 2652, 2654, 2659, 2660, 2662, 2664,1094 266 9, 2671, 2679, 2680, 2681, 2686, 2687, 2691, 2693, 2695,1095 269 7, 2699, 2701, 2708, 2710, 2712, 2714, 2716, 2718, 2720,1096 272 2, 2724, 2726, 2731, 2733, 2735, 2740, 2766, 2767, 2769,1097 277 3, 2774, 2778, 2780, 2782, 2784, 2786, 2788, 2795, 2797,1098 279 9, 2801, 2803, 2805, 2810, 2815, 2817, 2819, 2837, 2839,1099 284 4, 28451023 0, 300, 300, 304, 311, 312, 313, 317, 318, 319, 1024 323, 324, 328, 329, 333, 334, 338, 342, 343, 354, 1025 356, 358, 360, 365, 366, 372, 376, 378, 379, 381, 1026 382, 384, 386, 388, 397, 398, 404, 405, 409, 410, 1027 414, 418, 420, 422, 424, 429, 432, 434, 436, 441, 1028 454, 456, 458, 460, 462, 464, 466, 468, 470, 472, 1029 474, 481, 482, 488, 489, 490, 491, 495, 496, 498, 1030 503, 504, 506, 508, 513, 514, 516, 521, 522, 524, 1031 529, 530, 532, 534, 536, 541, 542, 544, 549, 550, 1032 555, 556, 561, 562, 567, 568, 573, 574, 579, 580, 1033 583, 585, 590, 595, 596, 598, 604, 605, 609, 610, 1034 611, 612, 613, 614, 615, 616, 617, 618, 619, 620, 1035 626, 628, 630, 632, 637, 638, 643, 644, 650, 651, 1036 657, 658, 659, 660, 661, 662, 663, 664, 665, 675, 1037 682, 684, 694, 695, 700, 702, 708, 710, 714, 715, 1038 720, 725, 728, 730, 732, 742, 744, 755, 756, 758, 1039 762, 764, 768, 769, 774, 775, 779, 784, 785, 789, 1040 791, 797, 798, 802, 804, 806, 808, 814, 815, 819, 1041 821, 826, 828, 830, 835, 837, 842, 844, 848, 851, 1042 855, 858, 862, 864, 866, 868, 873, 875, 877, 882, 1043 884, 886, 888, 890, 895, 897, 899, 901, 906, 918, 1044 919, 924, 926, 931, 935, 937, 939, 941, 943, 949, 1045 950, 956, 957, 961, 962, 967, 969, 975, 976, 978, 1046 983, 988, 998, 1000, 1004, 1005, 1010, 1012, 1016, 1017, 1047 1021, 1023, 1027, 1028, 1032, 1033, 1037, 1038, 1053, 1054, 1048 1055, 1056, 1057, 1061, 1066, 1073, 1083, 1088, 1093, 1101, 1049 1106, 1111, 1116, 1121, 1129, 1151, 1156, 1163, 1165, 1172, 1050 1177, 1182, 1193, 1198, 1203, 1208, 1213, 1222, 1227, 1235, 1051 1236, 1237, 1238, 1244, 1249, 1257, 1258, 1259, 1260, 1264, 1052 1265, 1266, 1267, 1272, 1273, 1282, 1283, 1288, 1289, 1294, 1053 1296, 1298, 1300, 1302, 1305, 1304, 1316, 1317, 1319, 1329, 1054 1330, 1335, 1337, 1339, 1341, 1343, 1346, 1348, 1351, 1356, 1055 1358, 1360, 1362, 1364, 1366, 1368, 1370, 1372, 1374, 1376, 1056 1378, 1380, 1386, 1387, 1389, 1391, 1393, 1398, 1399, 1405, 1057 1406, 1408, 1410, 1415, 1417, 1419, 1421, 1426, 1427, 1429, 1058 1431, 1436, 1437, 1439, 1444, 1445, 1447, 1449, 1454, 1456, 1059 1458, 1463, 1464, 1468, 1470, 1476, 1475, 1479, 1481, 1486, 1060 1488, 1494, 1495, 1500, 1501, 1503, 1504, 1513, 1514, 1516, 1061 1518, 1523, 1525, 1531, 1532, 1534, 1537, 1540, 1545, 1546, 1062 1551, 1556, 1560, 1562, 1568, 1567, 1574, 1576, 1582, 1583, 1063 1591, 1592, 1596, 1597, 1598, 1600, 1602, 1609, 1610, 1612, 1064 1614, 1619, 1620, 1626, 1627, 1631, 1632, 1637, 1638, 1639, 1065 1641, 1649, 1650, 1652, 1655, 1657, 1661, 1662, 1663, 1665, 1066 1667, 1671, 1676, 1684, 1685, 1694, 1696, 1701, 1702, 1703, 1067 1707, 1708, 1709, 1713, 1714, 1715, 1719, 1720, 1721, 1726, 1068 1727, 1728, 1729, 1735, 1736, 1738, 1743, 1744, 1749, 1750, 1069 1751, 1752, 1753, 1768, 1769, 1774, 1775, 1781, 1783, 1786, 1070 1788, 1790, 1813, 1814, 1816, 1818, 1823, 1824, 1826, 1831, 1071 1836, 1837, 1843, 1842, 1846, 1850, 1852, 1854, 1860, 1861, 1072 1866, 1871, 1873, 1878, 1880, 1881, 1883, 1888, 1890, 1892, 1073 1897, 1899, 1904, 1909, 1917, 1923, 1922, 1936, 1937, 1942, 1074 1943, 1947, 1952, 1957, 1965, 1970, 1981, 1982, 1987, 1988, 1075 1994, 1995, 1999, 2000, 2001, 2004, 2003, 2014, 2023, 2029, 1076 2035, 2044, 2050, 2056, 2062, 2068, 2076, 2082, 2090, 2096, 1077 2105, 2106, 2107, 2111, 2115, 2117, 2122, 2123, 2127, 2128, 1078 2133, 2139, 2140, 2143, 2145, 2146, 2150, 2151, 2152, 2153, 1079 2187, 2189, 2190, 2192, 2197, 2202, 2207, 2209, 2211, 2216, 1080 2218, 2220, 2222, 2227, 2229, 2238, 2240, 2241, 2246, 2248, 1081 2250, 2255, 2257, 2259, 2264, 2266, 2268, 2277, 2278, 2279, 1082 2283, 2285, 2287, 2292, 2294, 2296, 2301, 2303, 2305, 2320, 1083 2322, 2323, 2325, 2330, 2331, 2336, 2338, 2340, 2345, 2347, 1084 2349, 2351, 2356, 2358, 2360, 2370, 2372, 2373, 2375, 2380, 1085 2382, 2384, 2389, 2391, 2393, 2395, 2400, 2402, 2404, 2435, 1086 2437, 2438, 2440, 2445, 2450, 2458, 2460, 2462, 2467, 2469, 1087 2474, 2476, 2490, 2491, 2493, 2498, 2500, 2502, 2504, 2506, 1088 2511, 2512, 2514, 2516, 2521, 2523, 2525, 2531, 2533, 2535, 1089 2539, 2541, 2543, 2545, 2559, 2560, 2562, 2567, 2569, 2571, 1090 2573, 2575, 2580, 2581, 2583, 2585, 2590, 2592, 2594, 2600, 1091 2601, 2603, 2612, 2615, 2617, 2620, 2622, 2624, 2637, 2638, 1092 2640, 2645, 2647, 2649, 2651, 2653, 2658, 2659, 2661, 2663, 1093 2668, 2670, 2678, 2679, 2680, 2685, 2686, 2690, 2692, 2694, 1094 2696, 2698, 2700, 2707, 2709, 2711, 2713, 2715, 2717, 2719, 1095 2721, 2723, 2725, 2730, 2732, 2734, 2739, 2765, 2766, 2768, 1096 2772, 2773, 2777, 2779, 2781, 2783, 2785, 2787, 2794, 2796, 1097 2798, 2800, 2802, 2804, 2809, 2814, 2816, 2818, 2836, 2838, 1098 2843, 2844 1100 1099 }; 1101 1100 #endif … … 4972 4971 4973 4972 /* Line 1806 of yacc.c */ 4974 #line 30 1"parser.yy"4973 #line 300 "parser.yy" 4975 4974 { typedefTable.enterScope(); } 4976 4975 break; … … 4979 4978 4980 4979 /* Line 1806 of yacc.c */ 4981 #line 30 5"parser.yy"4980 #line 304 "parser.yy" 4982 4981 { typedefTable.leaveScope(); } 4983 4982 break; … … 4986 4985 4987 4986 /* Line 1806 of yacc.c */ 4987 #line 311 "parser.yy" 4988 { (yyval.en) = new ExpressionNode( build_constantInteger( *(yyvsp[(1) - (1)].tok) ) ); } 4989 break; 4990 4991 case 5: 4992 4993 /* Line 1806 of yacc.c */ 4988 4994 #line 312 "parser.yy" 4989 { (yyval.en) = new ExpressionNode( build_constant Integer( *(yyvsp[(1) - (1)].tok) ) ); }4990 break; 4991 4992 case 5:4995 { (yyval.en) = new ExpressionNode( build_constantFloat( *(yyvsp[(1) - (1)].tok) ) ); } 4996 break; 4997 4998 case 6: 4993 4999 4994 5000 /* Line 1806 of yacc.c */ 4995 5001 #line 313 "parser.yy" 4996 { (yyval.en) = new ExpressionNode( build_constantFloat( *(yyvsp[(1) - (1)].tok) ) ); }4997 break;4998 4999 case 6:5000 5001 /* Line 1806 of yacc.c */5002 #line 314 "parser.yy"5003 5002 { (yyval.en) = new ExpressionNode( build_constantChar( *(yyvsp[(1) - (1)].tok) ) ); } 5004 5003 break; … … 5007 5006 5008 5007 /* Line 1806 of yacc.c */ 5009 #line 33 9"parser.yy"5008 #line 338 "parser.yy" 5010 5009 { (yyval.constant) = build_constantStr( *(yyvsp[(1) - (1)].str) ); } 5011 5010 break; … … 5014 5013 5015 5014 /* Line 1806 of yacc.c */ 5016 #line 34 3"parser.yy"5015 #line 342 "parser.yy" 5017 5016 { (yyval.str) = (yyvsp[(1) - (1)].tok); } 5018 5017 break; … … 5021 5020 5022 5021 /* Line 1806 of yacc.c */ 5023 #line 34 5"parser.yy"5022 #line 344 "parser.yy" 5024 5023 { 5025 5024 appendStr( (yyvsp[(1) - (2)].str), (yyvsp[(2) - (2)].tok) ); // append 2nd juxtaposed string to 1st … … 5032 5031 5033 5032 /* Line 1806 of yacc.c */ 5034 #line 35 6"parser.yy"5033 #line 355 "parser.yy" 5035 5034 { (yyval.en) = new ExpressionNode( build_varref( (yyvsp[(1) - (1)].tok) ) ); } 5036 5035 break; … … 5039 5038 5040 5039 /* Line 1806 of yacc.c */ 5041 #line 35 8"parser.yy"5040 #line 357 "parser.yy" 5042 5041 { (yyval.en) = new ExpressionNode( build_varref( (yyvsp[(1) - (1)].tok) ) ); } 5043 5042 break; … … 5046 5045 5047 5046 /* Line 1806 of yacc.c */ 5048 #line 3 60"parser.yy"5047 #line 359 "parser.yy" 5049 5048 { (yyval.en) = (yyvsp[(2) - (3)].en); } 5050 5049 break; … … 5053 5052 5054 5053 /* Line 1806 of yacc.c */ 5055 #line 36 2"parser.yy"5054 #line 361 "parser.yy" 5056 5055 { (yyval.en) = new ExpressionNode( build_valexpr( (yyvsp[(2) - (3)].sn) ) ); } 5057 5056 break; … … 5060 5059 5061 5060 /* Line 1806 of yacc.c */ 5062 #line 37 2"parser.yy"5061 #line 371 "parser.yy" 5063 5062 { (yyval.en) = new ExpressionNode( build_binary_val( OperKinds::Index, (yyvsp[(1) - (6)].en), (yyvsp[(4) - (6)].en) ) ); } 5064 5063 break; … … 5067 5066 5068 5067 /* Line 1806 of yacc.c */ 5069 #line 37 4"parser.yy"5068 #line 373 "parser.yy" 5070 5069 { (yyval.en) = new ExpressionNode( build_func( (yyvsp[(1) - (4)].en), (yyvsp[(3) - (4)].en) ) ); } 5071 5070 break; … … 5074 5073 5075 5074 /* Line 1806 of yacc.c */ 5076 #line 37 8"parser.yy"5075 #line 377 "parser.yy" 5077 5076 { (yyval.en) = new ExpressionNode( build_fieldSel( (yyvsp[(1) - (3)].en), build_varref( (yyvsp[(3) - (3)].tok) ) ) ); } 5078 5077 break; … … 5081 5080 5082 5081 /* Line 1806 of yacc.c */ 5083 #line 38 1"parser.yy"5082 #line 380 "parser.yy" 5084 5083 { (yyval.en) = new ExpressionNode( build_pfieldSel( (yyvsp[(1) - (3)].en), build_varref( (yyvsp[(3) - (3)].tok) ) ) ); } 5085 5084 break; … … 5088 5087 5089 5088 /* Line 1806 of yacc.c */ 5090 #line 38 4"parser.yy"5089 #line 383 "parser.yy" 5091 5090 { (yyval.en) = new ExpressionNode( build_unary_ptr( OperKinds::IncrPost, (yyvsp[(1) - (2)].en) ) ); } 5092 5091 break; … … 5095 5094 5096 5095 /* Line 1806 of yacc.c */ 5097 #line 38 6"parser.yy"5096 #line 385 "parser.yy" 5098 5097 { (yyval.en) = new ExpressionNode( build_unary_ptr( OperKinds::DecrPost, (yyvsp[(1) - (2)].en) ) ); } 5099 5098 break; … … 5102 5101 5103 5102 /* Line 1806 of yacc.c */ 5104 #line 38 8"parser.yy"5103 #line 387 "parser.yy" 5105 5104 { (yyval.en) = new ExpressionNode( build_compoundLiteral( (yyvsp[(2) - (7)].decl), new InitializerNode( (yyvsp[(5) - (7)].in), true ) ) ); } 5106 5105 break; … … 5109 5108 5110 5109 /* Line 1806 of yacc.c */ 5111 #line 3 90"parser.yy"5110 #line 389 "parser.yy" 5112 5111 { 5113 5112 Token fn; 5114 fn.str = new std::string( "?{}" ); // location undefined - use location of '{'?5113 fn.str = new std::string( "?{}" ); // location undefined - use location of '{'? 5115 5114 (yyval.en) = new ExpressionNode( new ConstructorExpr( build_func( new ExpressionNode( build_varref( fn ) ), (ExpressionNode *)( (yyvsp[(1) - (4)].en) )->set_last( (yyvsp[(3) - (4)].en) ) ) ) ); 5116 5115 } … … 5120 5119 5121 5120 /* Line 1806 of yacc.c */ 5122 #line 400"parser.yy"5121 #line 399 "parser.yy" 5123 5122 { (yyval.en) = (ExpressionNode *)( (yyvsp[(1) - (3)].en)->set_last( (yyvsp[(3) - (3)].en) )); } 5124 5123 break; … … 5127 5126 5128 5127 /* Line 1806 of yacc.c */ 5129 #line 40 5"parser.yy"5128 #line 404 "parser.yy" 5130 5129 { (yyval.en) = 0; } 5131 5130 break; … … 5134 5133 5135 5134 /* Line 1806 of yacc.c */ 5136 #line 41 1"parser.yy"5135 #line 410 "parser.yy" 5137 5136 { (yyval.en) = (ExpressionNode *)(yyvsp[(1) - (3)].en)->set_last( (yyvsp[(3) - (3)].en) ); } 5138 5137 break; … … 5141 5140 5142 5141 /* Line 1806 of yacc.c */ 5143 #line 41 6"parser.yy"5142 #line 415 "parser.yy" 5144 5143 { (yyval.en) = new ExpressionNode( build_varref( (yyvsp[(1) - (1)].tok) ) ); } 5145 5144 break; … … 5148 5147 5149 5148 /* Line 1806 of yacc.c */ 5150 #line 4 20"parser.yy"5149 #line 419 "parser.yy" 5151 5150 { (yyval.en) = new ExpressionNode( build_fieldSel( (yyvsp[(3) - (3)].en), build_varref( (yyvsp[(1) - (3)].tok) ) ) ); } 5152 5151 break; … … 5155 5154 5156 5155 /* Line 1806 of yacc.c */ 5157 #line 42 2"parser.yy"5156 #line 421 "parser.yy" 5158 5157 { (yyval.en) = new ExpressionNode( build_fieldSel( (yyvsp[(5) - (7)].en), build_varref( (yyvsp[(1) - (7)].tok) ) ) ); } 5159 5158 break; … … 5162 5161 5163 5162 /* Line 1806 of yacc.c */ 5164 #line 42 4"parser.yy"5163 #line 423 "parser.yy" 5165 5164 { (yyval.en) = new ExpressionNode( build_pfieldSel( (yyvsp[(3) - (3)].en), build_varref( (yyvsp[(1) - (3)].tok) ) ) ); } 5166 5165 break; … … 5169 5168 5170 5169 /* Line 1806 of yacc.c */ 5171 #line 42 6"parser.yy"5170 #line 425 "parser.yy" 5172 5171 { (yyval.en) = new ExpressionNode( build_pfieldSel( (yyvsp[(5) - (7)].en), build_varref( (yyvsp[(1) - (7)].tok) ) ) ); } 5173 5172 break; … … 5176 5175 5177 5176 /* Line 1806 of yacc.c */ 5178 #line 43 4"parser.yy"5177 #line 433 "parser.yy" 5179 5178 { (yyval.en) = (yyvsp[(1) - (1)].en); } 5180 5179 break; … … 5183 5182 5184 5183 /* Line 1806 of yacc.c */ 5185 #line 43 6"parser.yy"5184 #line 435 "parser.yy" 5186 5185 { (yyval.en) = new ExpressionNode( (yyvsp[(1) - (1)].constant) ); } 5187 5186 break; … … 5190 5189 5191 5190 /* Line 1806 of yacc.c */ 5192 #line 43 8"parser.yy"5191 #line 437 "parser.yy" 5193 5192 { (yyval.en) = (yyvsp[(2) - (2)].en)->set_extension( true ); } 5194 5193 break; … … 5197 5196 5198 5197 /* Line 1806 of yacc.c */ 5199 #line 44 3"parser.yy"5198 #line 442 "parser.yy" 5200 5199 { 5201 5200 switch ( (yyvsp[(1) - (2)].op) ) { … … 5215 5214 5216 5215 /* Line 1806 of yacc.c */ 5217 #line 45 6"parser.yy"5216 #line 455 "parser.yy" 5218 5217 { (yyval.en) = new ExpressionNode( build_unary_val( (yyvsp[(1) - (2)].op), (yyvsp[(2) - (2)].en) ) ); } 5219 5218 break; … … 5222 5221 5223 5222 /* Line 1806 of yacc.c */ 5224 #line 45 8"parser.yy"5223 #line 457 "parser.yy" 5225 5224 { (yyval.en) = new ExpressionNode( build_unary_ptr( OperKinds::Incr, (yyvsp[(2) - (2)].en) ) ); } 5226 5225 break; … … 5229 5228 5230 5229 /* Line 1806 of yacc.c */ 5231 #line 4 60"parser.yy"5230 #line 459 "parser.yy" 5232 5231 { (yyval.en) = new ExpressionNode( build_unary_ptr( OperKinds::Decr, (yyvsp[(2) - (2)].en) ) ); } 5233 5232 break; … … 5236 5235 5237 5236 /* Line 1806 of yacc.c */ 5238 #line 46 2"parser.yy"5237 #line 461 "parser.yy" 5239 5238 { (yyval.en) = new ExpressionNode( build_sizeOfexpr( (yyvsp[(2) - (2)].en) ) ); } 5240 5239 break; … … 5243 5242 5244 5243 /* Line 1806 of yacc.c */ 5245 #line 46 4"parser.yy"5244 #line 463 "parser.yy" 5246 5245 { (yyval.en) = new ExpressionNode( build_sizeOftype( (yyvsp[(3) - (4)].decl) ) ); } 5247 5246 break; … … 5250 5249 5251 5250 /* Line 1806 of yacc.c */ 5252 #line 46 6"parser.yy"5251 #line 465 "parser.yy" 5253 5252 { (yyval.en) = new ExpressionNode( build_alignOfexpr( (yyvsp[(2) - (2)].en) ) ); } 5254 5253 break; … … 5257 5256 5258 5257 /* Line 1806 of yacc.c */ 5259 #line 46 8"parser.yy"5258 #line 467 "parser.yy" 5260 5259 { (yyval.en) = new ExpressionNode( build_alignOftype( (yyvsp[(3) - (4)].decl) ) ); } 5261 5260 break; … … 5264 5263 5265 5264 /* Line 1806 of yacc.c */ 5266 #line 4 70"parser.yy"5265 #line 469 "parser.yy" 5267 5266 { (yyval.en) = new ExpressionNode( build_offsetOf( (yyvsp[(3) - (6)].decl), build_varref( (yyvsp[(5) - (6)].tok) ) ) ); } 5268 5267 break; … … 5271 5270 5272 5271 /* Line 1806 of yacc.c */ 5273 #line 47 2"parser.yy"5272 #line 471 "parser.yy" 5274 5273 { (yyval.en) = new ExpressionNode( build_attrexpr( build_varref( (yyvsp[(1) - (1)].tok) ), nullptr ) ); } 5275 5274 break; … … 5278 5277 5279 5278 /* Line 1806 of yacc.c */ 5280 #line 47 4"parser.yy"5279 #line 473 "parser.yy" 5281 5280 { (yyval.en) = new ExpressionNode( build_attrexpr( build_varref( (yyvsp[(1) - (4)].tok) ), (yyvsp[(3) - (4)].en) ) ); } 5282 5281 break; … … 5285 5284 5286 5285 /* Line 1806 of yacc.c */ 5287 #line 47 6"parser.yy"5286 #line 475 "parser.yy" 5288 5287 { (yyval.en) = new ExpressionNode( build_attrtype( build_varref( (yyvsp[(1) - (4)].tok) ), (yyvsp[(3) - (4)].decl) ) ); } 5289 5288 break; … … 5292 5291 5293 5292 /* Line 1806 of yacc.c */ 5293 #line 481 "parser.yy" 5294 { (yyval.op) = OperKinds::PointTo; } 5295 break; 5296 5297 case 62: 5298 5299 /* Line 1806 of yacc.c */ 5294 5300 #line 482 "parser.yy" 5295 { (yyval.op) = OperKinds::PointTo; }5296 break;5297 5298 case 62:5299 5300 /* Line 1806 of yacc.c */5301 #line 483 "parser.yy"5302 5301 { (yyval.op) = OperKinds::AddressOf; } 5303 5302 break; … … 5306 5305 5307 5306 /* Line 1806 of yacc.c */ 5307 #line 488 "parser.yy" 5308 { (yyval.op) = OperKinds::UnPlus; } 5309 break; 5310 5311 case 64: 5312 5313 /* Line 1806 of yacc.c */ 5308 5314 #line 489 "parser.yy" 5309 { (yyval.op) = OperKinds::Un Plus; }5310 break; 5311 5312 case 6 4:5315 { (yyval.op) = OperKinds::UnMinus; } 5316 break; 5317 5318 case 65: 5313 5319 5314 5320 /* Line 1806 of yacc.c */ 5315 5321 #line 490 "parser.yy" 5316 { (yyval.op) = OperKinds:: UnMinus; }5317 break; 5318 5319 case 6 5:5322 { (yyval.op) = OperKinds::Neg; } 5323 break; 5324 5325 case 66: 5320 5326 5321 5327 /* Line 1806 of yacc.c */ 5322 5328 #line 491 "parser.yy" 5323 { (yyval.op) = OperKinds::Neg; }5324 break;5325 5326 case 66:5327 5328 /* Line 1806 of yacc.c */5329 #line 492 "parser.yy"5330 5329 { (yyval.op) = OperKinds::BitNeg; } 5331 5330 break; … … 5334 5333 5335 5334 /* Line 1806 of yacc.c */ 5336 #line 49 8"parser.yy"5335 #line 497 "parser.yy" 5337 5336 { (yyval.en) = new ExpressionNode( build_cast( (yyvsp[(2) - (4)].decl), (yyvsp[(4) - (4)].en) ) ); } 5338 5337 break; … … 5341 5340 5342 5341 /* Line 1806 of yacc.c */ 5343 #line 500"parser.yy"5342 #line 499 "parser.yy" 5344 5343 { (yyval.en) = new ExpressionNode( build_cast( (yyvsp[(2) - (4)].decl), (yyvsp[(4) - (4)].en) ) ); } 5345 5344 break; … … 5348 5347 5349 5348 /* Line 1806 of yacc.c */ 5350 #line 50 6"parser.yy"5349 #line 505 "parser.yy" 5351 5350 { (yyval.en) = new ExpressionNode( build_binary_val( OperKinds::Mul, (yyvsp[(1) - (3)].en), (yyvsp[(3) - (3)].en) ) ); } 5352 5351 break; … … 5355 5354 5356 5355 /* Line 1806 of yacc.c */ 5357 #line 50 8"parser.yy"5356 #line 507 "parser.yy" 5358 5357 { (yyval.en) = new ExpressionNode( build_binary_val( OperKinds::Div, (yyvsp[(1) - (3)].en), (yyvsp[(3) - (3)].en) ) ); } 5359 5358 break; … … 5362 5361 5363 5362 /* Line 1806 of yacc.c */ 5364 #line 5 10"parser.yy"5363 #line 509 "parser.yy" 5365 5364 { (yyval.en) = new ExpressionNode( build_binary_val( OperKinds::Mod, (yyvsp[(1) - (3)].en), (yyvsp[(3) - (3)].en) ) ); } 5366 5365 break; … … 5369 5368 5370 5369 /* Line 1806 of yacc.c */ 5371 #line 51 6"parser.yy"5370 #line 515 "parser.yy" 5372 5371 { (yyval.en) = new ExpressionNode( build_binary_val( OperKinds::Plus, (yyvsp[(1) - (3)].en), (yyvsp[(3) - (3)].en) ) ); } 5373 5372 break; … … 5376 5375 5377 5376 /* Line 1806 of yacc.c */ 5378 #line 51 8"parser.yy"5377 #line 517 "parser.yy" 5379 5378 { (yyval.en) = new ExpressionNode( build_binary_val( OperKinds::Minus, (yyvsp[(1) - (3)].en), (yyvsp[(3) - (3)].en) ) ); } 5380 5379 break; … … 5383 5382 5384 5383 /* Line 1806 of yacc.c */ 5385 #line 52 4"parser.yy"5384 #line 523 "parser.yy" 5386 5385 { (yyval.en) = new ExpressionNode( build_binary_val( OperKinds::LShift, (yyvsp[(1) - (3)].en), (yyvsp[(3) - (3)].en) ) ); } 5387 5386 break; … … 5390 5389 5391 5390 /* Line 1806 of yacc.c */ 5392 #line 52 6"parser.yy"5391 #line 525 "parser.yy" 5393 5392 { (yyval.en) = new ExpressionNode( build_binary_val( OperKinds::RShift, (yyvsp[(1) - (3)].en), (yyvsp[(3) - (3)].en) ) ); } 5394 5393 break; … … 5397 5396 5398 5397 /* Line 1806 of yacc.c */ 5399 #line 53 2"parser.yy"5398 #line 531 "parser.yy" 5400 5399 { (yyval.en) = new ExpressionNode( build_binary_val( OperKinds::LThan, (yyvsp[(1) - (3)].en), (yyvsp[(3) - (3)].en) ) ); } 5401 5400 break; … … 5404 5403 5405 5404 /* Line 1806 of yacc.c */ 5406 #line 53 4"parser.yy"5405 #line 533 "parser.yy" 5407 5406 { (yyval.en) = new ExpressionNode( build_binary_val( OperKinds::GThan, (yyvsp[(1) - (3)].en), (yyvsp[(3) - (3)].en) ) ); } 5408 5407 break; … … 5411 5410 5412 5411 /* Line 1806 of yacc.c */ 5413 #line 53 6"parser.yy"5412 #line 535 "parser.yy" 5414 5413 { (yyval.en) = new ExpressionNode( build_binary_val( OperKinds::LEThan, (yyvsp[(1) - (3)].en), (yyvsp[(3) - (3)].en) ) ); } 5415 5414 break; … … 5418 5417 5419 5418 /* Line 1806 of yacc.c */ 5420 #line 53 8"parser.yy"5419 #line 537 "parser.yy" 5421 5420 { (yyval.en) = new ExpressionNode( build_binary_val( OperKinds::GEThan, (yyvsp[(1) - (3)].en), (yyvsp[(3) - (3)].en) ) ); } 5422 5421 break; … … 5425 5424 5426 5425 /* Line 1806 of yacc.c */ 5427 #line 54 4"parser.yy"5426 #line 543 "parser.yy" 5428 5427 { (yyval.en) = new ExpressionNode( build_binary_val( OperKinds::Eq, (yyvsp[(1) - (3)].en), (yyvsp[(3) - (3)].en) ) ); } 5429 5428 break; … … 5432 5431 5433 5432 /* Line 1806 of yacc.c */ 5434 #line 54 6"parser.yy"5433 #line 545 "parser.yy" 5435 5434 { (yyval.en) = new ExpressionNode( build_binary_val( OperKinds::Neq, (yyvsp[(1) - (3)].en), (yyvsp[(3) - (3)].en) ) ); } 5436 5435 break; … … 5439 5438 5440 5439 /* Line 1806 of yacc.c */ 5441 #line 55 2"parser.yy"5440 #line 551 "parser.yy" 5442 5441 { (yyval.en) = new ExpressionNode( build_binary_val( OperKinds::BitAnd, (yyvsp[(1) - (3)].en), (yyvsp[(3) - (3)].en) ) ); } 5443 5442 break; … … 5446 5445 5447 5446 /* Line 1806 of yacc.c */ 5448 #line 55 8"parser.yy"5447 #line 557 "parser.yy" 5449 5448 { (yyval.en) = new ExpressionNode( build_binary_val( OperKinds::Xor, (yyvsp[(1) - (3)].en), (yyvsp[(3) - (3)].en) ) ); } 5450 5449 break; … … 5453 5452 5454 5453 /* Line 1806 of yacc.c */ 5455 #line 56 4"parser.yy"5454 #line 563 "parser.yy" 5456 5455 { (yyval.en) = new ExpressionNode( build_binary_val( OperKinds::BitOr, (yyvsp[(1) - (3)].en), (yyvsp[(3) - (3)].en) ) ); } 5457 5456 break; … … 5460 5459 5461 5460 /* Line 1806 of yacc.c */ 5462 #line 5 70"parser.yy"5461 #line 569 "parser.yy" 5463 5462 { (yyval.en) = new ExpressionNode( build_and_or( (yyvsp[(1) - (3)].en), (yyvsp[(3) - (3)].en), true ) ); } 5464 5463 break; … … 5467 5466 5468 5467 /* Line 1806 of yacc.c */ 5469 #line 57 6"parser.yy"5468 #line 575 "parser.yy" 5470 5469 { (yyval.en) = new ExpressionNode( build_and_or( (yyvsp[(1) - (3)].en), (yyvsp[(3) - (3)].en), false ) ); } 5471 5470 break; … … 5474 5473 5475 5474 /* Line 1806 of yacc.c */ 5476 #line 58 2"parser.yy"5475 #line 581 "parser.yy" 5477 5476 { (yyval.en) = new ExpressionNode( build_cond( (yyvsp[(1) - (5)].en), (yyvsp[(3) - (5)].en), (yyvsp[(5) - (5)].en) ) ); } 5478 5477 break; … … 5481 5480 5482 5481 /* Line 1806 of yacc.c */ 5483 #line 58 5"parser.yy"5482 #line 584 "parser.yy" 5484 5483 { (yyval.en) = new ExpressionNode( build_cond( (yyvsp[(1) - (4)].en), (yyvsp[(1) - (4)].en), (yyvsp[(4) - (4)].en) ) ); } 5485 5484 break; … … 5488 5487 5489 5488 /* Line 1806 of yacc.c */ 5490 #line 58 7"parser.yy"5489 #line 586 "parser.yy" 5491 5490 { (yyval.en) = new ExpressionNode( build_cond( (yyvsp[(1) - (5)].en), (yyvsp[(3) - (5)].en), (yyvsp[(5) - (5)].en) ) ); } 5492 5491 break; … … 5495 5494 5496 5495 /* Line 1806 of yacc.c */ 5497 #line 59 8"parser.yy"5496 #line 597 "parser.yy" 5498 5497 { (yyval.en) = new ExpressionNode( build_binary_ptr( (yyvsp[(2) - (3)].op), (yyvsp[(1) - (3)].en), (yyvsp[(3) - (3)].en) ) ); } 5499 5498 break; … … 5502 5501 5503 5502 /* Line 1806 of yacc.c */ 5504 #line 600"parser.yy"5503 #line 599 "parser.yy" 5505 5504 { (yyval.en) = ( (yyvsp[(2) - (2)].en) == 0 ) ? (yyvsp[(1) - (2)].en) : new ExpressionNode( build_binary_ptr( OperKinds::Assign, (yyvsp[(1) - (2)].en), (yyvsp[(2) - (2)].en) ) ); } 5506 5505 break; … … 5509 5508 5510 5509 /* Line 1806 of yacc.c */ 5511 #line 60 5"parser.yy"5510 #line 604 "parser.yy" 5512 5511 { (yyval.en) = nullptr; } 5513 5512 break; … … 5516 5515 5517 5516 /* Line 1806 of yacc.c */ 5517 #line 609 "parser.yy" 5518 { (yyval.op) = OperKinds::Assign; } 5519 break; 5520 5521 case 109: 5522 5523 /* Line 1806 of yacc.c */ 5518 5524 #line 610 "parser.yy" 5519 { (yyval.op) = OperKinds::A ssign; }5520 break; 5521 5522 case 1 09:5525 { (yyval.op) = OperKinds::AtAssn; } 5526 break; 5527 5528 case 110: 5523 5529 5524 5530 /* Line 1806 of yacc.c */ 5525 5531 #line 611 "parser.yy" 5526 { (yyval.op) = OperKinds:: AtAssn; }5527 break; 5528 5529 case 11 0:5532 { (yyval.op) = OperKinds::MulAssn; } 5533 break; 5534 5535 case 111: 5530 5536 5531 5537 /* Line 1806 of yacc.c */ 5532 5538 #line 612 "parser.yy" 5533 { (yyval.op) = OperKinds:: MulAssn; }5534 break; 5535 5536 case 11 1:5539 { (yyval.op) = OperKinds::DivAssn; } 5540 break; 5541 5542 case 112: 5537 5543 5538 5544 /* Line 1806 of yacc.c */ 5539 5545 #line 613 "parser.yy" 5540 { (yyval.op) = OperKinds:: DivAssn; }5541 break; 5542 5543 case 11 2:5546 { (yyval.op) = OperKinds::ModAssn; } 5547 break; 5548 5549 case 113: 5544 5550 5545 5551 /* Line 1806 of yacc.c */ 5546 5552 #line 614 "parser.yy" 5547 { (yyval.op) = OperKinds:: ModAssn; }5548 break; 5549 5550 case 11 3:5553 { (yyval.op) = OperKinds::PlusAssn; } 5554 break; 5555 5556 case 114: 5551 5557 5552 5558 /* Line 1806 of yacc.c */ 5553 5559 #line 615 "parser.yy" 5554 { (yyval.op) = OperKinds:: PlusAssn; }5555 break; 5556 5557 case 11 4:5560 { (yyval.op) = OperKinds::MinusAssn; } 5561 break; 5562 5563 case 115: 5558 5564 5559 5565 /* Line 1806 of yacc.c */ 5560 5566 #line 616 "parser.yy" 5561 { (yyval.op) = OperKinds:: MinusAssn; }5562 break; 5563 5564 case 11 5:5567 { (yyval.op) = OperKinds::LSAssn; } 5568 break; 5569 5570 case 116: 5565 5571 5566 5572 /* Line 1806 of yacc.c */ 5567 5573 #line 617 "parser.yy" 5568 { (yyval.op) = OperKinds:: LSAssn; }5569 break; 5570 5571 case 11 6:5574 { (yyval.op) = OperKinds::RSAssn; } 5575 break; 5576 5577 case 117: 5572 5578 5573 5579 /* Line 1806 of yacc.c */ 5574 5580 #line 618 "parser.yy" 5575 { (yyval.op) = OperKinds:: RSAssn; }5576 break; 5577 5578 case 11 7:5581 { (yyval.op) = OperKinds::AndAssn; } 5582 break; 5583 5584 case 118: 5579 5585 5580 5586 /* Line 1806 of yacc.c */ 5581 5587 #line 619 "parser.yy" 5582 { (yyval.op) = OperKinds:: AndAssn; }5583 break; 5584 5585 case 11 8:5588 { (yyval.op) = OperKinds::ERAssn; } 5589 break; 5590 5591 case 119: 5586 5592 5587 5593 /* Line 1806 of yacc.c */ 5588 5594 #line 620 "parser.yy" 5589 { (yyval.op) = OperKinds::ERAssn; }5590 break;5591 5592 case 119:5593 5594 /* Line 1806 of yacc.c */5595 #line 621 "parser.yy"5596 5595 { (yyval.op) = OperKinds::OrAssn; } 5597 5596 break; … … 5600 5599 5601 5600 /* Line 1806 of yacc.c */ 5602 #line 62 8"parser.yy"5601 #line 627 "parser.yy" 5603 5602 { (yyval.en) = new ExpressionNode( build_tuple() ); } 5604 5603 break; … … 5607 5606 5608 5607 /* Line 1806 of yacc.c */ 5609 #line 6 30"parser.yy"5608 #line 629 "parser.yy" 5610 5609 { (yyval.en) = new ExpressionNode( build_tuple( (yyvsp[(3) - (5)].en) ) ); } 5611 5610 break; … … 5614 5613 5615 5614 /* Line 1806 of yacc.c */ 5616 #line 63 2"parser.yy"5615 #line 631 "parser.yy" 5617 5616 { (yyval.en) = new ExpressionNode( build_tuple( (ExpressionNode *)(new ExpressionNode( nullptr ) )->set_last( (yyvsp[(4) - (6)].en) ) ) ); } 5618 5617 break; … … 5621 5620 5622 5621 /* Line 1806 of yacc.c */ 5623 #line 63 4"parser.yy"5622 #line 633 "parser.yy" 5624 5623 { (yyval.en) = new ExpressionNode( build_tuple( (ExpressionNode *)(yyvsp[(3) - (7)].en)->set_last( (yyvsp[(5) - (7)].en) ) ) ); } 5625 5624 break; … … 5628 5627 5629 5628 /* Line 1806 of yacc.c */ 5630 #line 6 40"parser.yy"5629 #line 639 "parser.yy" 5631 5630 { (yyval.en) = (ExpressionNode *)(yyvsp[(1) - (3)].en)->set_last( (yyvsp[(3) - (3)].en) ); } 5632 5631 break; … … 5635 5634 5636 5635 /* Line 1806 of yacc.c */ 5637 #line 64 6"parser.yy"5636 #line 645 "parser.yy" 5638 5637 { (yyval.en) = new ExpressionNode( build_comma( (yyvsp[(1) - (3)].en), (yyvsp[(3) - (3)].en) ) ); } 5639 5638 break; … … 5642 5641 5643 5642 /* Line 1806 of yacc.c */ 5644 #line 65 1"parser.yy"5643 #line 650 "parser.yy" 5645 5644 { (yyval.en) = 0; } 5646 5645 break; … … 5649 5648 5650 5649 /* Line 1806 of yacc.c */ 5651 #line 6 60"parser.yy"5650 #line 659 "parser.yy" 5652 5651 { (yyval.sn) = (yyvsp[(1) - (1)].sn); } 5653 5652 break; … … 5656 5655 5657 5656 /* Line 1806 of yacc.c */ 5658 #line 66 7"parser.yy"5657 #line 666 "parser.yy" 5659 5658 { 5660 5659 Token fn; 5661 fn.str = new st ring( "^?{}" );// location undefined5660 fn.str = new std::string( "^?{}" ); // location undefined 5662 5661 (yyval.sn) = new StatementNode( build_expr( new ExpressionNode( build_func( new ExpressionNode( build_varref( fn ) ), (ExpressionNode *)( (yyvsp[(2) - (6)].en) )->set_last( (yyvsp[(4) - (6)].en) ) ) ) ) ); 5663 5662 } … … 5667 5666 5668 5667 /* Line 1806 of yacc.c */ 5669 #line 67 7"parser.yy"5668 #line 676 "parser.yy" 5670 5669 { 5671 5670 (yyval.sn) = (yyvsp[(4) - (4)].sn)->add_label( (yyvsp[(1) - (4)].tok) ); … … 5676 5675 5677 5676 /* Line 1806 of yacc.c */ 5678 #line 68 4"parser.yy"5677 #line 683 "parser.yy" 5679 5678 { (yyval.sn) = new StatementNode( build_compound( (StatementNode *)0 ) ); } 5680 5679 break; … … 5683 5682 5684 5683 /* Line 1806 of yacc.c */ 5685 #line 69 1"parser.yy"5684 #line 690 "parser.yy" 5686 5685 { (yyval.sn) = new StatementNode( build_compound( (yyvsp[(5) - (7)].sn) ) ); } 5687 5686 break; … … 5690 5689 5691 5690 /* Line 1806 of yacc.c */ 5692 #line 69 7"parser.yy"5691 #line 696 "parser.yy" 5693 5692 { if ( (yyvsp[(1) - (3)].sn) != 0 ) { (yyvsp[(1) - (3)].sn)->set_last( (yyvsp[(3) - (3)].sn) ); (yyval.sn) = (yyvsp[(1) - (3)].sn); } } 5694 5693 break; … … 5697 5696 5698 5697 /* Line 1806 of yacc.c */ 5699 #line 70 2"parser.yy"5698 #line 701 "parser.yy" 5700 5699 { (yyval.sn) = new StatementNode( (yyvsp[(1) - (1)].decl) ); } 5701 5700 break; … … 5704 5703 5705 5704 /* Line 1806 of yacc.c */ 5706 #line 70 4"parser.yy"5705 #line 703 "parser.yy" 5707 5706 { // mark all fields in list 5708 5707 for ( DeclarationNode *iter = (yyvsp[(2) - (2)].decl); iter != nullptr; iter = (DeclarationNode *)iter->get_next() ) … … 5715 5714 5716 5715 /* Line 1806 of yacc.c */ 5717 #line 7 10"parser.yy"5716 #line 709 "parser.yy" 5718 5717 { (yyval.sn) = new StatementNode( (yyvsp[(1) - (1)].decl) ); } 5719 5718 break; … … 5722 5721 5723 5722 /* Line 1806 of yacc.c */ 5724 #line 71 7"parser.yy"5723 #line 716 "parser.yy" 5725 5724 { if ( (yyvsp[(1) - (2)].sn) != 0 ) { (yyvsp[(1) - (2)].sn)->set_last( (yyvsp[(2) - (2)].sn) ); (yyval.sn) = (yyvsp[(1) - (2)].sn); } } 5726 5725 break; … … 5729 5728 5730 5729 /* Line 1806 of yacc.c */ 5731 #line 72 2"parser.yy"5730 #line 721 "parser.yy" 5732 5731 { (yyval.sn) = new StatementNode( build_expr( (yyvsp[(1) - (2)].en) ) ); } 5733 5732 break; … … 5736 5735 5737 5736 /* Line 1806 of yacc.c */ 5738 #line 72 8"parser.yy"5737 #line 727 "parser.yy" 5739 5738 { (yyval.sn) = new StatementNode( build_if( (yyvsp[(3) - (5)].en), (yyvsp[(5) - (5)].sn), nullptr ) ); } 5740 5739 break; … … 5743 5742 5744 5743 /* Line 1806 of yacc.c */ 5745 #line 7 30"parser.yy"5744 #line 729 "parser.yy" 5746 5745 { (yyval.sn) = new StatementNode( build_if( (yyvsp[(3) - (7)].en), (yyvsp[(5) - (7)].sn), (yyvsp[(7) - (7)].sn) ) ); } 5747 5746 break; … … 5750 5749 5751 5750 /* Line 1806 of yacc.c */ 5752 #line 73 2"parser.yy"5751 #line 731 "parser.yy" 5753 5752 { (yyval.sn) = new StatementNode( build_switch( (yyvsp[(3) - (5)].en), (yyvsp[(5) - (5)].sn) ) ); } 5754 5753 break; … … 5757 5756 5758 5757 /* Line 1806 of yacc.c */ 5759 #line 73 4"parser.yy"5758 #line 733 "parser.yy" 5760 5759 { 5761 5760 StatementNode *sw = new StatementNode( build_switch( (yyvsp[(3) - (9)].en), (yyvsp[(8) - (9)].sn) ) ); … … 5772 5771 5773 5772 /* Line 1806 of yacc.c */ 5774 #line 74 4"parser.yy"5773 #line 743 "parser.yy" 5775 5774 { (yyval.sn) = new StatementNode( build_switch( (yyvsp[(3) - (5)].en), (yyvsp[(5) - (5)].sn) ) ); } 5776 5775 break; … … 5779 5778 5780 5779 /* Line 1806 of yacc.c */ 5781 #line 74 6"parser.yy"5780 #line 745 "parser.yy" 5782 5781 { 5783 5782 StatementNode *sw = new StatementNode( build_switch( (yyvsp[(3) - (9)].en), (yyvsp[(8) - (9)].sn) ) ); … … 5789 5788 5790 5789 /* Line 1806 of yacc.c */ 5791 #line 75 6"parser.yy"5790 #line 755 "parser.yy" 5792 5791 { (yyval.en) = (yyvsp[(1) - (1)].en); } 5793 5792 break; … … 5796 5795 5797 5796 /* Line 1806 of yacc.c */ 5798 #line 75 8"parser.yy"5797 #line 757 "parser.yy" 5799 5798 { (yyval.en) = new ExpressionNode( build_range( (yyvsp[(1) - (3)].en), (yyvsp[(3) - (3)].en) ) ); } 5800 5799 break; … … 5803 5802 5804 5803 /* Line 1806 of yacc.c */ 5805 #line 76 3"parser.yy"5804 #line 762 "parser.yy" 5806 5805 { (yyval.sn) = new StatementNode( build_case( (yyvsp[(1) - (1)].en) ) ); } 5807 5806 break; … … 5810 5809 5811 5810 /* Line 1806 of yacc.c */ 5812 #line 76 5"parser.yy"5811 #line 764 "parser.yy" 5813 5812 { (yyval.sn) = (StatementNode *)((yyvsp[(1) - (3)].sn)->set_last( new StatementNode( build_case( (yyvsp[(3) - (3)].en) ) ) ) ); } 5814 5813 break; … … 5817 5816 5818 5817 /* Line 1806 of yacc.c */ 5818 #line 768 "parser.yy" 5819 { (yyval.sn) = (yyvsp[(2) - (3)].sn); } 5820 break; 5821 5822 case 163: 5823 5824 /* Line 1806 of yacc.c */ 5819 5825 #line 769 "parser.yy" 5820 { (yyval.sn) = (yyvsp[(2) - (3)].sn); }5821 break;5822 5823 case 163:5824 5825 /* Line 1806 of yacc.c */5826 #line 770 "parser.yy"5827 5826 { (yyval.sn) = new StatementNode( build_default() ); } 5828 5827 break; … … 5831 5830 5832 5831 /* Line 1806 of yacc.c */ 5833 #line 77 6"parser.yy"5832 #line 775 "parser.yy" 5834 5833 { (yyval.sn) = (StatementNode *)( (yyvsp[(1) - (2)].sn)->set_last( (yyvsp[(2) - (2)].sn) )); } 5835 5834 break; … … 5838 5837 5839 5838 /* Line 1806 of yacc.c */ 5840 #line 7 80"parser.yy"5839 #line 779 "parser.yy" 5841 5840 { (yyval.sn) = (yyvsp[(1) - (2)].sn)->append_last_case( new StatementNode( build_compound( (yyvsp[(2) - (2)].sn) ) ) ); } 5842 5841 break; … … 5845 5844 5846 5845 /* Line 1806 of yacc.c */ 5847 #line 78 5"parser.yy"5846 #line 784 "parser.yy" 5848 5847 { (yyval.sn) = 0; } 5849 5848 break; … … 5852 5851 5853 5852 /* Line 1806 of yacc.c */ 5854 #line 79 1"parser.yy"5853 #line 790 "parser.yy" 5855 5854 { (yyval.sn) = (yyvsp[(1) - (2)].sn)->append_last_case( new StatementNode( build_compound( (yyvsp[(2) - (2)].sn) ) ) ); } 5856 5855 break; … … 5859 5858 5860 5859 /* Line 1806 of yacc.c */ 5861 #line 79 3"parser.yy"5860 #line 792 "parser.yy" 5862 5861 { (yyval.sn) = (StatementNode *)( (yyvsp[(1) - (3)].sn)->set_last( (yyvsp[(2) - (3)].sn)->append_last_case( new StatementNode( build_compound( (yyvsp[(3) - (3)].sn) ) ) ) ) ); } 5863 5862 break; … … 5866 5865 5867 5866 /* Line 1806 of yacc.c */ 5868 #line 79 8"parser.yy"5867 #line 797 "parser.yy" 5869 5868 { (yyval.sn) = 0; } 5870 5869 break; … … 5873 5872 5874 5873 /* Line 1806 of yacc.c */ 5875 #line 80 4"parser.yy"5874 #line 803 "parser.yy" 5876 5875 { (yyval.sn) = (yyvsp[(1) - (2)].sn)->append_last_case( (yyvsp[(2) - (2)].sn) ); } 5877 5876 break; … … 5880 5879 5881 5880 /* Line 1806 of yacc.c */ 5882 #line 80 6"parser.yy"5881 #line 805 "parser.yy" 5883 5882 { (yyval.sn) = (yyvsp[(1) - (3)].sn)->append_last_case( new StatementNode( build_compound( (StatementNode *)(yyvsp[(2) - (3)].sn)->set_last( (yyvsp[(3) - (3)].sn) ) ) ) ); } 5884 5883 break; … … 5887 5886 5888 5887 /* Line 1806 of yacc.c */ 5889 #line 80 8"parser.yy"5888 #line 807 "parser.yy" 5890 5889 { (yyval.sn) = (StatementNode *)( (yyvsp[(1) - (3)].sn)->set_last( (yyvsp[(2) - (3)].sn)->append_last_case( (yyvsp[(3) - (3)].sn) ))); } 5891 5890 break; … … 5894 5893 5895 5894 /* Line 1806 of yacc.c */ 5896 #line 8 10"parser.yy"5895 #line 809 "parser.yy" 5897 5896 { (yyval.sn) = (StatementNode *)( (yyvsp[(1) - (4)].sn)->set_last( (yyvsp[(2) - (4)].sn)->append_last_case( new StatementNode( build_compound( (StatementNode *)(yyvsp[(3) - (4)].sn)->set_last( (yyvsp[(4) - (4)].sn) ) ) ) ) ) ); } 5898 5897 break; … … 5901 5900 5902 5901 /* Line 1806 of yacc.c */ 5903 #line 81 5"parser.yy"5902 #line 814 "parser.yy" 5904 5903 { (yyval.sn) = new StatementNode( build_branch( BranchStmt::Break ) ); } 5905 5904 break; … … 5908 5907 5909 5908 /* Line 1806 of yacc.c */ 5910 #line 82 1"parser.yy"5909 #line 820 "parser.yy" 5911 5910 { (yyval.sn) = 0; } 5912 5911 break; … … 5915 5914 5916 5915 /* Line 1806 of yacc.c */ 5917 #line 82 3"parser.yy"5916 #line 822 "parser.yy" 5918 5917 { (yyval.sn) = 0; } 5919 5918 break; … … 5922 5921 5923 5922 /* Line 1806 of yacc.c */ 5924 #line 82 8"parser.yy"5923 #line 827 "parser.yy" 5925 5924 { (yyval.sn) = new StatementNode( build_while( (yyvsp[(3) - (5)].en), (yyvsp[(5) - (5)].sn) ) ); } 5926 5925 break; … … 5929 5928 5930 5929 /* Line 1806 of yacc.c */ 5931 #line 8 30"parser.yy"5930 #line 829 "parser.yy" 5932 5931 { (yyval.sn) = new StatementNode( build_while( (yyvsp[(5) - (7)].en), (yyvsp[(2) - (7)].sn), true ) ); } 5933 5932 break; … … 5936 5935 5937 5936 /* Line 1806 of yacc.c */ 5938 #line 83 2"parser.yy"5937 #line 831 "parser.yy" 5939 5938 { (yyval.sn) = new StatementNode( build_for( (yyvsp[(4) - (6)].fctl), (yyvsp[(6) - (6)].sn) ) ); } 5940 5939 break; … … 5943 5942 5944 5943 /* Line 1806 of yacc.c */ 5945 #line 83 7"parser.yy"5944 #line 836 "parser.yy" 5946 5945 { (yyval.fctl) = new ForCtl( (yyvsp[(1) - (6)].en), (yyvsp[(4) - (6)].en), (yyvsp[(6) - (6)].en) ); } 5947 5946 break; … … 5950 5949 5951 5950 /* Line 1806 of yacc.c */ 5952 #line 83 9"parser.yy"5951 #line 838 "parser.yy" 5953 5952 { (yyval.fctl) = new ForCtl( (yyvsp[(1) - (4)].decl), (yyvsp[(2) - (4)].en), (yyvsp[(4) - (4)].en) ); } 5954 5953 break; … … 5957 5956 5958 5957 /* Line 1806 of yacc.c */ 5959 #line 84 4"parser.yy"5958 #line 843 "parser.yy" 5960 5959 { (yyval.sn) = new StatementNode( build_branch( (yyvsp[(2) - (3)].tok), BranchStmt::Goto ) ); } 5961 5960 break; … … 5964 5963 5965 5964 /* Line 1806 of yacc.c */ 5966 #line 84 8"parser.yy"5965 #line 847 "parser.yy" 5967 5966 { (yyval.sn) = new StatementNode( build_computedgoto( (yyvsp[(3) - (4)].en) ) ); } 5968 5967 break; … … 5971 5970 5972 5971 /* Line 1806 of yacc.c */ 5973 #line 85 1"parser.yy"5972 #line 850 "parser.yy" 5974 5973 { (yyval.sn) = new StatementNode( build_branch( BranchStmt::Continue ) ); } 5975 5974 break; … … 5978 5977 5979 5978 /* Line 1806 of yacc.c */ 5980 #line 85 5"parser.yy"5979 #line 854 "parser.yy" 5981 5980 { (yyval.sn) = new StatementNode( build_branch( (yyvsp[(2) - (3)].tok), BranchStmt::Continue ) ); } 5982 5981 break; … … 5985 5984 5986 5985 /* Line 1806 of yacc.c */ 5987 #line 85 8"parser.yy"5986 #line 857 "parser.yy" 5988 5987 { (yyval.sn) = new StatementNode( build_branch( BranchStmt::Break ) ); } 5989 5988 break; … … 5992 5991 5993 5992 /* Line 1806 of yacc.c */ 5994 #line 86 2"parser.yy"5993 #line 861 "parser.yy" 5995 5994 { (yyval.sn) = new StatementNode( build_branch( (yyvsp[(2) - (3)].tok), BranchStmt::Break ) ); } 5996 5995 break; … … 5999 5998 6000 5999 /* Line 1806 of yacc.c */ 6001 #line 86 4"parser.yy"6000 #line 863 "parser.yy" 6002 6001 { (yyval.sn) = new StatementNode( build_return( (yyvsp[(2) - (3)].en) ) ); } 6003 6002 break; … … 6006 6005 6007 6006 /* Line 1806 of yacc.c */ 6008 #line 86 6"parser.yy"6007 #line 865 "parser.yy" 6009 6008 { (yyval.sn) = new StatementNode( build_throw( (yyvsp[(2) - (3)].en) ) ); } 6010 6009 break; … … 6013 6012 6014 6013 /* Line 1806 of yacc.c */ 6015 #line 86 8"parser.yy"6014 #line 867 "parser.yy" 6016 6015 { (yyval.sn) = new StatementNode( build_throw( (yyvsp[(2) - (3)].en) ) ); } 6017 6016 break; … … 6020 6019 6021 6020 /* Line 1806 of yacc.c */ 6022 #line 8 70"parser.yy"6021 #line 869 "parser.yy" 6023 6022 { (yyval.sn) = new StatementNode( build_throw( (yyvsp[(2) - (5)].en) ) ); } 6024 6023 break; … … 6027 6026 6028 6027 /* Line 1806 of yacc.c */ 6029 #line 87 5"parser.yy"6028 #line 874 "parser.yy" 6030 6029 { (yyval.sn) = new StatementNode( build_try( (yyvsp[(2) - (3)].sn), (yyvsp[(3) - (3)].sn), 0 ) ); } 6031 6030 break; … … 6034 6033 6035 6034 /* Line 1806 of yacc.c */ 6036 #line 87 7"parser.yy"6035 #line 876 "parser.yy" 6037 6036 { (yyval.sn) = new StatementNode( build_try( (yyvsp[(2) - (3)].sn), 0, (yyvsp[(3) - (3)].sn) ) ); } 6038 6037 break; … … 6041 6040 6042 6041 /* Line 1806 of yacc.c */ 6043 #line 87 9"parser.yy"6042 #line 878 "parser.yy" 6044 6043 { (yyval.sn) = new StatementNode( build_try( (yyvsp[(2) - (4)].sn), (yyvsp[(3) - (4)].sn), (yyvsp[(4) - (4)].sn) ) ); } 6045 6044 break; … … 6048 6047 6049 6048 /* Line 1806 of yacc.c */ 6050 #line 88 6"parser.yy"6049 #line 885 "parser.yy" 6051 6050 { (yyval.sn) = new StatementNode( build_catch( 0, (yyvsp[(5) - (5)].sn), true ) ); } 6052 6051 break; … … 6055 6054 6056 6055 /* Line 1806 of yacc.c */ 6057 #line 88 8"parser.yy"6056 #line 887 "parser.yy" 6058 6057 { (yyval.sn) = (StatementNode *)(yyvsp[(1) - (6)].sn)->set_last( new StatementNode( build_catch( 0, (yyvsp[(6) - (6)].sn), true ) ) ); } 6059 6058 break; … … 6062 6061 6063 6062 /* Line 1806 of yacc.c */ 6064 #line 8 90"parser.yy"6063 #line 889 "parser.yy" 6065 6064 { (yyval.sn) = new StatementNode( build_catch( 0, (yyvsp[(5) - (5)].sn), true ) ); } 6066 6065 break; … … 6069 6068 6070 6069 /* Line 1806 of yacc.c */ 6071 #line 89 2"parser.yy"6070 #line 891 "parser.yy" 6072 6071 { (yyval.sn) = (StatementNode *)(yyvsp[(1) - (6)].sn)->set_last( new StatementNode( build_catch( 0, (yyvsp[(6) - (6)].sn), true ) ) ); } 6073 6072 break; … … 6076 6075 6077 6076 /* Line 1806 of yacc.c */ 6078 #line 89 7"parser.yy"6077 #line 896 "parser.yy" 6079 6078 { (yyval.sn) = new StatementNode( build_catch( (yyvsp[(5) - (9)].decl), (yyvsp[(8) - (9)].sn) ) ); } 6080 6079 break; … … 6083 6082 6084 6083 /* Line 1806 of yacc.c */ 6085 #line 89 9"parser.yy"6084 #line 898 "parser.yy" 6086 6085 { (yyval.sn) = (StatementNode *)(yyvsp[(1) - (10)].sn)->set_last( new StatementNode( build_catch( (yyvsp[(6) - (10)].decl), (yyvsp[(9) - (10)].sn) ) ) ); } 6087 6086 break; … … 6090 6089 6091 6090 /* Line 1806 of yacc.c */ 6092 #line 90 1"parser.yy"6091 #line 900 "parser.yy" 6093 6092 { (yyval.sn) = new StatementNode( build_catch( (yyvsp[(5) - (9)].decl), (yyvsp[(8) - (9)].sn) ) ); } 6094 6093 break; … … 6097 6096 6098 6097 /* Line 1806 of yacc.c */ 6099 #line 90 3"parser.yy"6098 #line 902 "parser.yy" 6100 6099 { (yyval.sn) = (StatementNode *)(yyvsp[(1) - (10)].sn)->set_last( new StatementNode( build_catch( (yyvsp[(6) - (10)].decl), (yyvsp[(9) - (10)].sn) ) ) ); } 6101 6100 break; … … 6104 6103 6105 6104 /* Line 1806 of yacc.c */ 6106 #line 90 8"parser.yy"6105 #line 907 "parser.yy" 6107 6106 { 6108 6107 (yyval.sn) = new StatementNode( build_finally( (yyvsp[(2) - (2)].sn) ) ); … … 6113 6112 6114 6113 /* Line 1806 of yacc.c */ 6115 #line 92 1"parser.yy"6114 #line 920 "parser.yy" 6116 6115 { 6117 6116 typedefTable.addToEnclosingScope( TypedefTable::ID ); … … 6123 6122 6124 6123 /* Line 1806 of yacc.c */ 6125 #line 92 6"parser.yy"6124 #line 925 "parser.yy" 6126 6125 { (yyval.decl) = (yyvsp[(2) - (2)].decl)->addType( (yyvsp[(1) - (2)].decl) ); } 6127 6126 break; … … 6130 6129 6131 6130 /* Line 1806 of yacc.c */ 6132 #line 92 8"parser.yy"6131 #line 927 "parser.yy" 6133 6132 { 6134 6133 typedefTable.addToEnclosingScope( TypedefTable::ID ); … … 6140 6139 6141 6140 /* Line 1806 of yacc.c */ 6142 #line 93 7"parser.yy"6141 #line 936 "parser.yy" 6143 6142 { (yyval.sn) = new StatementNode( build_asmstmt( (yyvsp[(2) - (6)].flag), (yyvsp[(4) - (6)].constant), 0 ) ); } 6144 6143 break; … … 6147 6146 6148 6147 /* Line 1806 of yacc.c */ 6149 #line 93 9"parser.yy"6148 #line 938 "parser.yy" 6150 6149 { (yyval.sn) = new StatementNode( build_asmstmt( (yyvsp[(2) - (8)].flag), (yyvsp[(4) - (8)].constant), (yyvsp[(6) - (8)].en) ) ); } 6151 6150 break; … … 6154 6153 6155 6154 /* Line 1806 of yacc.c */ 6156 #line 94 1"parser.yy"6155 #line 940 "parser.yy" 6157 6156 { (yyval.sn) = new StatementNode( build_asmstmt( (yyvsp[(2) - (10)].flag), (yyvsp[(4) - (10)].constant), (yyvsp[(6) - (10)].en), (yyvsp[(8) - (10)].en) ) ); } 6158 6157 break; … … 6161 6160 6162 6161 /* Line 1806 of yacc.c */ 6163 #line 94 3"parser.yy"6162 #line 942 "parser.yy" 6164 6163 { (yyval.sn) = new StatementNode( build_asmstmt( (yyvsp[(2) - (12)].flag), (yyvsp[(4) - (12)].constant), (yyvsp[(6) - (12)].en), (yyvsp[(8) - (12)].en), (yyvsp[(10) - (12)].en) ) ); } 6165 6164 break; … … 6168 6167 6169 6168 /* Line 1806 of yacc.c */ 6170 #line 94 5"parser.yy"6169 #line 944 "parser.yy" 6171 6170 { (yyval.sn) = new StatementNode( build_asmstmt( (yyvsp[(2) - (14)].flag), (yyvsp[(5) - (14)].constant), 0, (yyvsp[(8) - (14)].en), (yyvsp[(10) - (14)].en), (yyvsp[(12) - (14)].label) ) ); } 6172 6171 break; … … 6175 6174 6176 6175 /* Line 1806 of yacc.c */ 6177 #line 9 50"parser.yy"6176 #line 949 "parser.yy" 6178 6177 { (yyval.flag) = false; } 6179 6178 break; … … 6182 6181 6183 6182 /* Line 1806 of yacc.c */ 6184 #line 95 2"parser.yy"6183 #line 951 "parser.yy" 6185 6184 { (yyval.flag) = true; } 6186 6185 break; … … 6189 6188 6190 6189 /* Line 1806 of yacc.c */ 6191 #line 95 7"parser.yy"6190 #line 956 "parser.yy" 6192 6191 { (yyval.en) = 0; } 6193 6192 break; … … 6196 6195 6197 6196 /* Line 1806 of yacc.c */ 6198 #line 96 4"parser.yy"6197 #line 963 "parser.yy" 6199 6198 { (yyval.en) = (ExpressionNode *)(yyvsp[(1) - (3)].en)->set_last( (yyvsp[(3) - (3)].en) ); } 6200 6199 break; … … 6203 6202 6204 6203 /* Line 1806 of yacc.c */ 6205 #line 96 9"parser.yy"6204 #line 968 "parser.yy" 6206 6205 { (yyval.en) = new ExpressionNode( build_asmexpr( 0, (yyvsp[(1) - (4)].constant), (yyvsp[(3) - (4)].en) ) ); } 6207 6206 break; … … 6210 6209 6211 6210 /* Line 1806 of yacc.c */ 6212 #line 97 1"parser.yy"6211 #line 970 "parser.yy" 6213 6212 { (yyval.en) = new ExpressionNode( build_asmexpr( (yyvsp[(2) - (7)].en), (yyvsp[(4) - (7)].constant), (yyvsp[(6) - (7)].en) ) ); } 6214 6213 break; … … 6217 6216 6218 6217 /* Line 1806 of yacc.c */ 6219 #line 97 6"parser.yy"6218 #line 975 "parser.yy" 6220 6219 { (yyval.en) = 0; } 6221 6220 break; … … 6224 6223 6225 6224 /* Line 1806 of yacc.c */ 6226 #line 97 8"parser.yy"6225 #line 977 "parser.yy" 6227 6226 { (yyval.en) = new ExpressionNode( (yyvsp[(1) - (1)].constant) ); } 6228 6227 break; … … 6231 6230 6232 6231 /* Line 1806 of yacc.c */ 6233 #line 9 80"parser.yy"6232 #line 979 "parser.yy" 6234 6233 { (yyval.en) = (ExpressionNode *)(yyvsp[(1) - (3)].en)->set_last( new ExpressionNode( (yyvsp[(3) - (3)].constant) ) ); } 6235 6234 break; … … 6238 6237 6239 6238 /* Line 1806 of yacc.c */ 6240 #line 98 5"parser.yy"6239 #line 984 "parser.yy" 6241 6240 { 6242 6241 (yyval.label) = new LabelNode(); (yyval.label)->labels.push_back( *(yyvsp[(1) - (1)].tok) ); … … 6248 6247 6249 6248 /* Line 1806 of yacc.c */ 6250 #line 9 90"parser.yy"6249 #line 989 "parser.yy" 6251 6250 { 6252 6251 (yyval.label) = (yyvsp[(1) - (3)].label); (yyvsp[(1) - (3)].label)->labels.push_back( *(yyvsp[(3) - (3)].tok) ); … … 6258 6257 6259 6258 /* Line 1806 of yacc.c */ 6260 #line 1000"parser.yy"6259 #line 999 "parser.yy" 6261 6260 { (yyval.decl) = 0; } 6262 6261 break; … … 6265 6264 6266 6265 /* Line 1806 of yacc.c */ 6267 #line 100 7"parser.yy"6266 #line 1006 "parser.yy" 6268 6267 { (yyval.decl) = (yyvsp[(1) - (3)].decl)->appendList( (yyvsp[(3) - (3)].decl) ); } 6269 6268 break; … … 6272 6271 6273 6272 /* Line 1806 of yacc.c */ 6274 #line 101 2"parser.yy"6273 #line 1011 "parser.yy" 6275 6274 { (yyval.decl) = 0; } 6276 6275 break; … … 6279 6278 6280 6279 /* Line 1806 of yacc.c */ 6281 #line 101 9"parser.yy"6280 #line 1018 "parser.yy" 6282 6281 { (yyval.decl) = (yyvsp[(1) - (3)].decl)->appendList( (yyvsp[(3) - (3)].decl) ); } 6283 6282 break; 6284 6283 6285 6284 case 244: 6285 6286 /* Line 1806 of yacc.c */ 6287 #line 1032 "parser.yy" 6288 {} 6289 break; 6290 6291 case 245: 6286 6292 6287 6293 /* Line 1806 of yacc.c */ … … 6290 6296 break; 6291 6297 6292 case 245:6293 6294 /* Line 1806 of yacc.c */6295 #line 1034 "parser.yy"6296 {}6297 break;6298 6299 6298 case 253: 6300 6299 6301 6300 /* Line 1806 of yacc.c */ 6302 #line 106 3"parser.yy"6301 #line 1062 "parser.yy" 6303 6302 { 6304 6303 typedefTable.addToEnclosingScope( TypedefTable::ID ); … … 6310 6309 6311 6310 /* Line 1806 of yacc.c */ 6312 #line 10 70"parser.yy"6311 #line 1069 "parser.yy" 6313 6312 { 6314 6313 typedefTable.addToEnclosingScope( TypedefTable::ID ); … … 6320 6319 6321 6320 /* Line 1806 of yacc.c */ 6322 #line 107 5"parser.yy"6321 #line 1074 "parser.yy" 6323 6322 { 6324 6323 typedefTable.addToEnclosingScope( *(yyvsp[(5) - (6)].tok), TypedefTable::ID ); … … 6330 6329 6331 6330 /* Line 1806 of yacc.c */ 6332 #line 108 5"parser.yy"6331 #line 1084 "parser.yy" 6333 6332 { 6334 6333 typedefTable.setNextIdentifier( *(yyvsp[(2) - (3)].tok) ); … … 6340 6339 6341 6340 /* Line 1806 of yacc.c */ 6342 #line 10 90"parser.yy"6341 #line 1089 "parser.yy" 6343 6342 { 6344 6343 typedefTable.setNextIdentifier( *(yyvsp[(2) - (3)].tok) ); … … 6350 6349 6351 6350 /* Line 1806 of yacc.c */ 6352 #line 109 5"parser.yy"6351 #line 1094 "parser.yy" 6353 6352 { 6354 6353 typedefTable.setNextIdentifier( *(yyvsp[(3) - (4)].tok) ); … … 6360 6359 6361 6360 /* Line 1806 of yacc.c */ 6362 #line 110 3"parser.yy"6361 #line 1102 "parser.yy" 6363 6362 { 6364 6363 typedefTable.addToEnclosingScope( TypedefTable::ID ); … … 6370 6369 6371 6370 /* Line 1806 of yacc.c */ 6372 #line 110 8"parser.yy"6371 #line 1107 "parser.yy" 6373 6372 { 6374 6373 typedefTable.addToEnclosingScope( TypedefTable::ID ); … … 6380 6379 6381 6380 /* Line 1806 of yacc.c */ 6382 #line 111 3"parser.yy"6381 #line 1112 "parser.yy" 6383 6382 { 6384 6383 typedefTable.addToEnclosingScope( TypedefTable::ID ); … … 6390 6389 6391 6390 /* Line 1806 of yacc.c */ 6392 #line 111 8"parser.yy"6391 #line 1117 "parser.yy" 6393 6392 { 6394 6393 typedefTable.addToEnclosingScope( TypedefTable::ID ); … … 6400 6399 6401 6400 /* Line 1806 of yacc.c */ 6402 #line 112 3"parser.yy"6401 #line 1122 "parser.yy" 6403 6402 { 6404 6403 typedefTable.addToEnclosingScope( *(yyvsp[(5) - (5)].tok), TypedefTable::ID ); … … 6410 6409 6411 6410 /* Line 1806 of yacc.c */ 6412 #line 113 1"parser.yy"6411 #line 1130 "parser.yy" 6413 6412 { 6414 6413 (yyval.decl) = DeclarationNode::newFunction( (yyvsp[(3) - (8)].tok), DeclarationNode::newTuple( 0 ), (yyvsp[(6) - (8)].decl), 0, true ); … … 6419 6418 6420 6419 /* Line 1806 of yacc.c */ 6421 #line 115 4"parser.yy"6420 #line 1153 "parser.yy" 6422 6421 { 6423 6422 (yyval.decl) = DeclarationNode::newFunction( (yyvsp[(2) - (7)].tok), (yyvsp[(1) - (7)].decl), (yyvsp[(5) - (7)].decl), 0, true ); … … 6428 6427 6429 6428 /* Line 1806 of yacc.c */ 6430 #line 115 8"parser.yy"6429 #line 1157 "parser.yy" 6431 6430 { 6432 6431 (yyval.decl) = DeclarationNode::newFunction( (yyvsp[(2) - (7)].tok), (yyvsp[(1) - (7)].decl), (yyvsp[(5) - (7)].decl), 0, true ); … … 6437 6436 6438 6437 /* Line 1806 of yacc.c */ 6439 #line 116 5"parser.yy"6438 #line 1164 "parser.yy" 6440 6439 { (yyval.decl) = DeclarationNode::newTuple( (yyvsp[(3) - (5)].decl) ); } 6441 6440 break; … … 6444 6443 6445 6444 /* Line 1806 of yacc.c */ 6446 #line 116 9"parser.yy"6445 #line 1168 "parser.yy" 6447 6446 { (yyval.decl) = DeclarationNode::newTuple( (yyvsp[(3) - (9)].decl)->appendList( (yyvsp[(7) - (9)].decl) ) ); } 6448 6447 break; … … 6451 6450 6452 6451 /* Line 1806 of yacc.c */ 6453 #line 117 4"parser.yy"6452 #line 1173 "parser.yy" 6454 6453 { 6455 6454 typedefTable.addToEnclosingScope( TypedefTable::TD ); … … 6461 6460 6462 6461 /* Line 1806 of yacc.c */ 6463 #line 117 9"parser.yy"6462 #line 1178 "parser.yy" 6464 6463 { 6465 6464 typedefTable.addToEnclosingScope( TypedefTable::TD ); … … 6471 6470 6472 6471 /* Line 1806 of yacc.c */ 6473 #line 118 4"parser.yy"6472 #line 1183 "parser.yy" 6474 6473 { 6475 6474 typedefTable.addToEnclosingScope( *(yyvsp[(5) - (5)].tok), TypedefTable::TD ); … … 6481 6480 6482 6481 /* Line 1806 of yacc.c */ 6483 #line 119 5"parser.yy"6482 #line 1194 "parser.yy" 6484 6483 { 6485 6484 typedefTable.addToEnclosingScope( TypedefTable::TD ); … … 6491 6490 6492 6491 /* Line 1806 of yacc.c */ 6493 #line 1 200"parser.yy"6492 #line 1199 "parser.yy" 6494 6493 { 6495 6494 typedefTable.addToEnclosingScope( TypedefTable::TD ); … … 6501 6500 6502 6501 /* Line 1806 of yacc.c */ 6503 #line 120 5"parser.yy"6502 #line 1204 "parser.yy" 6504 6503 { 6505 6504 typedefTable.addToEnclosingScope( TypedefTable::TD ); … … 6511 6510 6512 6511 /* Line 1806 of yacc.c */ 6513 #line 12 10"parser.yy"6512 #line 1209 "parser.yy" 6514 6513 { 6515 6514 typedefTable.addToEnclosingScope( TypedefTable::TD ); … … 6521 6520 6522 6521 /* Line 1806 of yacc.c */ 6523 #line 121 5"parser.yy"6522 #line 1214 "parser.yy" 6524 6523 { 6525 6524 typedefTable.addToEnclosingScope( TypedefTable::TD ); … … 6531 6530 6532 6531 /* Line 1806 of yacc.c */ 6533 #line 122 4"parser.yy"6532 #line 1223 "parser.yy" 6534 6533 { 6535 6534 typedefTable.addToEnclosingScope( *(yyvsp[(2) - (4)].tok), TypedefTable::TD ); … … 6541 6540 6542 6541 /* Line 1806 of yacc.c */ 6543 #line 122 9"parser.yy"6542 #line 1228 "parser.yy" 6544 6543 { 6545 6544 typedefTable.addToEnclosingScope( *(yyvsp[(5) - (7)].tok), TypedefTable::TD ); … … 6551 6550 6552 6551 /* Line 1806 of yacc.c */ 6553 #line 124 6"parser.yy"6552 #line 1245 "parser.yy" 6554 6553 { 6555 6554 typedefTable.addToEnclosingScope( TypedefTable::ID ); … … 6561 6560 6562 6561 /* Line 1806 of yacc.c */ 6563 #line 125 1"parser.yy"6562 #line 1250 "parser.yy" 6564 6563 { 6565 6564 typedefTable.addToEnclosingScope( TypedefTable::ID ); … … 6571 6570 6572 6571 /* Line 1806 of yacc.c */ 6573 #line 127 3"parser.yy"6572 #line 1272 "parser.yy" 6574 6573 { (yyval.decl) = 0; } 6575 6574 break; … … 6578 6577 6579 6578 /* Line 1806 of yacc.c */ 6580 #line 128 5"parser.yy"6579 #line 1284 "parser.yy" 6581 6580 { (yyval.decl) = (yyvsp[(1) - (2)].decl)->addQualifiers( (yyvsp[(2) - (2)].decl) ); } 6582 6581 break; … … 6585 6584 6586 6585 /* Line 1806 of yacc.c */ 6587 #line 129 6"parser.yy"6586 #line 1295 "parser.yy" 6588 6587 { (yyval.decl) = DeclarationNode::newQualifier( DeclarationNode::Const ); } 6589 6588 break; … … 6592 6591 6593 6592 /* Line 1806 of yacc.c */ 6594 #line 129 8"parser.yy"6593 #line 1297 "parser.yy" 6595 6594 { (yyval.decl) = DeclarationNode::newQualifier( DeclarationNode::Restrict ); } 6596 6595 break; … … 6599 6598 6600 6599 /* Line 1806 of yacc.c */ 6601 #line 1 300"parser.yy"6600 #line 1299 "parser.yy" 6602 6601 { (yyval.decl) = DeclarationNode::newQualifier( DeclarationNode::Volatile ); } 6603 6602 break; … … 6606 6605 6607 6606 /* Line 1806 of yacc.c */ 6608 #line 130 2"parser.yy"6607 #line 1301 "parser.yy" 6609 6608 { (yyval.decl) = DeclarationNode::newQualifier( DeclarationNode::Lvalue ); } 6610 6609 break; … … 6613 6612 6614 6613 /* Line 1806 of yacc.c */ 6615 #line 130 4"parser.yy"6614 #line 1303 "parser.yy" 6616 6615 { (yyval.decl) = DeclarationNode::newQualifier( DeclarationNode::Atomic ); } 6617 6616 break; … … 6620 6619 6621 6620 /* Line 1806 of yacc.c */ 6622 #line 130 6"parser.yy"6621 #line 1305 "parser.yy" 6623 6622 { 6624 6623 typedefTable.enterScope(); … … 6629 6628 6630 6629 /* Line 1806 of yacc.c */ 6631 #line 13 10"parser.yy"6630 #line 1309 "parser.yy" 6632 6631 { 6633 6632 typedefTable.leaveScope(); … … 6639 6638 6640 6639 /* Line 1806 of yacc.c */ 6641 #line 131 9"parser.yy"6640 #line 1318 "parser.yy" 6642 6641 { (yyval.decl) = (yyvsp[(1) - (2)].decl)->addQualifiers( (yyvsp[(2) - (2)].decl) ); } 6643 6642 break; … … 6646 6645 6647 6646 /* Line 1806 of yacc.c */ 6648 #line 132 1"parser.yy"6647 #line 1320 "parser.yy" 6649 6648 { (yyval.decl) = (yyvsp[(1) - (3)].decl)->addQualifiers( (yyvsp[(2) - (3)].decl) )->addQualifiers( (yyvsp[(3) - (3)].decl) ); } 6650 6649 break; … … 6653 6652 6654 6653 /* Line 1806 of yacc.c */ 6655 #line 133 2"parser.yy"6654 #line 1331 "parser.yy" 6656 6655 { (yyval.decl) = (yyvsp[(1) - (2)].decl)->addQualifiers( (yyvsp[(2) - (2)].decl) ); } 6657 6656 break; … … 6660 6659 6661 6660 /* Line 1806 of yacc.c */ 6662 #line 133 7"parser.yy"6661 #line 1336 "parser.yy" 6663 6662 { (yyval.decl) = DeclarationNode::newStorageClass( DeclarationNode::Extern ); } 6664 6663 break; … … 6667 6666 6668 6667 /* Line 1806 of yacc.c */ 6669 #line 133 9"parser.yy"6668 #line 1338 "parser.yy" 6670 6669 { (yyval.decl) = DeclarationNode::newStorageClass( DeclarationNode::Static ); } 6671 6670 break; … … 6674 6673 6675 6674 /* Line 1806 of yacc.c */ 6676 #line 134 1"parser.yy"6675 #line 1340 "parser.yy" 6677 6676 { (yyval.decl) = DeclarationNode::newStorageClass( DeclarationNode::Auto ); } 6678 6677 break; … … 6681 6680 6682 6681 /* Line 1806 of yacc.c */ 6683 #line 134 3"parser.yy"6682 #line 1342 "parser.yy" 6684 6683 { (yyval.decl) = DeclarationNode::newStorageClass( DeclarationNode::Register ); } 6685 6684 break; … … 6688 6687 6689 6688 /* Line 1806 of yacc.c */ 6690 #line 134 6"parser.yy"6689 #line 1345 "parser.yy" 6691 6690 { (yyval.decl) = new DeclarationNode; (yyval.decl)->isInline = true; } 6692 6691 break; … … 6695 6694 6696 6695 /* Line 1806 of yacc.c */ 6697 #line 134 8"parser.yy"6696 #line 1347 "parser.yy" 6698 6697 { (yyval.decl) = DeclarationNode::newStorageClass( DeclarationNode::Fortran ); } 6699 6698 break; … … 6702 6701 6703 6702 /* Line 1806 of yacc.c */ 6704 #line 135 1"parser.yy"6703 #line 1350 "parser.yy" 6705 6704 { (yyval.decl) = new DeclarationNode; (yyval.decl)->isNoreturn = true; } 6706 6705 break; … … 6709 6708 6710 6709 /* Line 1806 of yacc.c */ 6711 #line 135 3"parser.yy"6710 #line 1352 "parser.yy" 6712 6711 { (yyval.decl) = DeclarationNode::newStorageClass( DeclarationNode::Threadlocal ); } 6713 6712 break; … … 6716 6715 6717 6716 /* Line 1806 of yacc.c */ 6718 #line 135 8"parser.yy"6717 #line 1357 "parser.yy" 6719 6718 { (yyval.decl) = DeclarationNode::newBasicType( DeclarationNode::Char ); } 6720 6719 break; … … 6723 6722 6724 6723 /* Line 1806 of yacc.c */ 6725 #line 13 60"parser.yy"6724 #line 1359 "parser.yy" 6726 6725 { (yyval.decl) = DeclarationNode::newBasicType( DeclarationNode::Double ); } 6727 6726 break; … … 6730 6729 6731 6730 /* Line 1806 of yacc.c */ 6732 #line 136 2"parser.yy"6731 #line 1361 "parser.yy" 6733 6732 { (yyval.decl) = DeclarationNode::newBasicType( DeclarationNode::Float ); } 6734 6733 break; … … 6737 6736 6738 6737 /* Line 1806 of yacc.c */ 6739 #line 136 4"parser.yy"6738 #line 1363 "parser.yy" 6740 6739 { (yyval.decl) = DeclarationNode::newBasicType( DeclarationNode::Int ); } 6741 6740 break; … … 6744 6743 6745 6744 /* Line 1806 of yacc.c */ 6746 #line 136 6"parser.yy"6745 #line 1365 "parser.yy" 6747 6746 { (yyval.decl) = DeclarationNode::newLength( DeclarationNode::Long ); } 6748 6747 break; … … 6751 6750 6752 6751 /* Line 1806 of yacc.c */ 6753 #line 136 8"parser.yy"6752 #line 1367 "parser.yy" 6754 6753 { (yyval.decl) = DeclarationNode::newLength( DeclarationNode::Short ); } 6755 6754 break; … … 6758 6757 6759 6758 /* Line 1806 of yacc.c */ 6760 #line 13 70"parser.yy"6759 #line 1369 "parser.yy" 6761 6760 { (yyval.decl) = DeclarationNode::newSignedNess( DeclarationNode::Signed ); } 6762 6761 break; … … 6765 6764 6766 6765 /* Line 1806 of yacc.c */ 6767 #line 137 2"parser.yy"6766 #line 1371 "parser.yy" 6768 6767 { (yyval.decl) = DeclarationNode::newSignedNess( DeclarationNode::Unsigned ); } 6769 6768 break; … … 6772 6771 6773 6772 /* Line 1806 of yacc.c */ 6774 #line 137 4"parser.yy"6773 #line 1373 "parser.yy" 6775 6774 { (yyval.decl) = DeclarationNode::newBasicType( DeclarationNode::Void ); } 6776 6775 break; … … 6779 6778 6780 6779 /* Line 1806 of yacc.c */ 6781 #line 137 6"parser.yy"6780 #line 1375 "parser.yy" 6782 6781 { (yyval.decl) = DeclarationNode::newBasicType( DeclarationNode::Bool ); } 6783 6782 break; … … 6786 6785 6787 6786 /* Line 1806 of yacc.c */ 6788 #line 137 8"parser.yy"6787 #line 1377 "parser.yy" 6789 6788 { (yyval.decl) = DeclarationNode::newComplexType( DeclarationNode::Complex ); } 6790 6789 break; … … 6793 6792 6794 6793 /* Line 1806 of yacc.c */ 6795 #line 13 80"parser.yy"6794 #line 1379 "parser.yy" 6796 6795 { (yyval.decl) = DeclarationNode::newComplexType( DeclarationNode::Imaginary ); } 6797 6796 break; … … 6800 6799 6801 6800 /* Line 1806 of yacc.c */ 6802 #line 138 2"parser.yy"6801 #line 1381 "parser.yy" 6803 6802 { (yyval.decl) = DeclarationNode::newBuiltinType( DeclarationNode::Valist ); } 6804 6803 break; … … 6807 6806 6808 6807 /* Line 1806 of yacc.c */ 6809 #line 138 9"parser.yy"6808 #line 1388 "parser.yy" 6810 6809 { (yyval.decl) = (yyvsp[(2) - (2)].decl)->addQualifiers( (yyvsp[(1) - (2)].decl) ); } 6811 6810 break; … … 6814 6813 6815 6814 /* Line 1806 of yacc.c */ 6816 #line 139 1"parser.yy"6815 #line 1390 "parser.yy" 6817 6816 { (yyval.decl) = (yyvsp[(1) - (2)].decl)->addQualifiers( (yyvsp[(2) - (2)].decl) ); } 6818 6817 break; … … 6821 6820 6822 6821 /* Line 1806 of yacc.c */ 6823 #line 139 3"parser.yy"6822 #line 1392 "parser.yy" 6824 6823 { (yyval.decl) = (yyvsp[(1) - (3)].decl)->addQualifiers( (yyvsp[(2) - (3)].decl) )->addQualifiers( (yyvsp[(3) - (3)].decl) ); } 6825 6824 break; … … 6828 6827 6829 6828 /* Line 1806 of yacc.c */ 6830 #line 139 5"parser.yy"6829 #line 1394 "parser.yy" 6831 6830 { (yyval.decl) = (yyvsp[(3) - (3)].decl)->addQualifiers( (yyvsp[(2) - (3)].decl) )->addType( (yyvsp[(1) - (3)].decl) ); } 6832 6831 break; … … 6835 6834 6836 6835 /* Line 1806 of yacc.c */ 6837 #line 140 1"parser.yy"6836 #line 1400 "parser.yy" 6838 6837 { (yyval.decl) = (yyvsp[(2) - (3)].decl)->addQualifiers( (yyvsp[(1) - (3)].decl) )->addQualifiers( (yyvsp[(3) - (3)].decl) ); } 6839 6838 break; … … 6842 6841 6843 6842 /* Line 1806 of yacc.c */ 6844 #line 140 8"parser.yy"6843 #line 1407 "parser.yy" 6845 6844 { (yyval.decl) = (yyvsp[(2) - (2)].decl)->addQualifiers( (yyvsp[(1) - (2)].decl) ); } 6846 6845 break; … … 6849 6848 6850 6849 /* Line 1806 of yacc.c */ 6851 #line 14 10"parser.yy"6850 #line 1409 "parser.yy" 6852 6851 { (yyval.decl) = (yyvsp[(1) - (2)].decl)->addQualifiers( (yyvsp[(2) - (2)].decl) ); } 6853 6852 break; … … 6856 6855 6857 6856 /* Line 1806 of yacc.c */ 6858 #line 141 2"parser.yy"6857 #line 1411 "parser.yy" 6859 6858 { (yyval.decl) = (yyvsp[(1) - (2)].decl)->addType( (yyvsp[(2) - (2)].decl) ); } 6860 6859 break; … … 6863 6862 6864 6863 /* Line 1806 of yacc.c */ 6865 #line 141 7"parser.yy"6864 #line 1416 "parser.yy" 6866 6865 { (yyval.decl) = (yyvsp[(3) - (4)].decl); } 6867 6866 break; … … 6870 6869 6871 6870 /* Line 1806 of yacc.c */ 6872 #line 141 9"parser.yy"6871 #line 1418 "parser.yy" 6873 6872 { (yyval.decl) = DeclarationNode::newTypeof( (yyvsp[(3) - (4)].en) ); } 6874 6873 break; … … 6877 6876 6878 6877 /* Line 1806 of yacc.c */ 6879 #line 142 1"parser.yy"6878 #line 1420 "parser.yy" 6880 6879 { (yyval.decl) = DeclarationNode::newAttr( (yyvsp[(1) - (4)].tok), (yyvsp[(3) - (4)].decl) ); } 6881 6880 break; … … 6884 6883 6885 6884 /* Line 1806 of yacc.c */ 6886 #line 142 3"parser.yy"6885 #line 1422 "parser.yy" 6887 6886 { (yyval.decl) = DeclarationNode::newAttr( (yyvsp[(1) - (4)].tok), (yyvsp[(3) - (4)].en) ); } 6888 6887 break; … … 6891 6890 6892 6891 /* Line 1806 of yacc.c */ 6893 #line 142 9"parser.yy"6892 #line 1428 "parser.yy" 6894 6893 { (yyval.decl) = (yyvsp[(2) - (2)].decl)->addQualifiers( (yyvsp[(1) - (2)].decl) ); } 6895 6894 break; … … 6898 6897 6899 6898 /* Line 1806 of yacc.c */ 6900 #line 143 1"parser.yy"6899 #line 1430 "parser.yy" 6901 6900 { (yyval.decl) = (yyvsp[(1) - (2)].decl)->addQualifiers( (yyvsp[(2) - (2)].decl) ); } 6902 6901 break; … … 6905 6904 6906 6905 /* Line 1806 of yacc.c */ 6907 #line 143 3"parser.yy"6906 #line 1432 "parser.yy" 6908 6907 { (yyval.decl) = (yyvsp[(1) - (3)].decl)->addQualifiers( (yyvsp[(2) - (3)].decl) )->addQualifiers( (yyvsp[(3) - (3)].decl) ); } 6909 6908 break; … … 6912 6911 6913 6912 /* Line 1806 of yacc.c */ 6914 #line 143 9"parser.yy"6913 #line 1438 "parser.yy" 6915 6914 { (yyval.decl) = (yyvsp[(2) - (2)].decl)->addQualifiers( (yyvsp[(1) - (2)].decl) ); } 6916 6915 break; … … 6919 6918 6920 6919 /* Line 1806 of yacc.c */ 6921 #line 144 1"parser.yy"6920 #line 1440 "parser.yy" 6922 6921 { (yyval.decl) = (yyvsp[(1) - (2)].decl)->addQualifiers( (yyvsp[(2) - (2)].decl) ); } 6923 6922 break; … … 6926 6925 6927 6926 /* Line 1806 of yacc.c */ 6928 #line 144 7"parser.yy"6927 #line 1446 "parser.yy" 6929 6928 { (yyval.decl) = (yyvsp[(2) - (2)].decl)->addQualifiers( (yyvsp[(1) - (2)].decl) ); } 6930 6929 break; … … 6933 6932 6934 6933 /* Line 1806 of yacc.c */ 6935 #line 144 9"parser.yy"6934 #line 1448 "parser.yy" 6936 6935 { (yyval.decl) = (yyvsp[(1) - (2)].decl)->addQualifiers( (yyvsp[(2) - (2)].decl) ); } 6937 6936 break; … … 6940 6939 6941 6940 /* Line 1806 of yacc.c */ 6942 #line 145 1"parser.yy"6941 #line 1450 "parser.yy" 6943 6942 { (yyval.decl) = (yyvsp[(1) - (3)].decl)->addQualifiers( (yyvsp[(2) - (3)].decl) )->addQualifiers( (yyvsp[(3) - (3)].decl) ); } 6944 6943 break; … … 6947 6946 6948 6947 /* Line 1806 of yacc.c */ 6949 #line 145 6"parser.yy"6948 #line 1455 "parser.yy" 6950 6949 { (yyval.decl) = DeclarationNode::newFromTypedef( (yyvsp[(1) - (1)].tok) ); } 6951 6950 break; … … 6954 6953 6955 6954 /* Line 1806 of yacc.c */ 6956 #line 145 8"parser.yy"6955 #line 1457 "parser.yy" 6957 6956 { (yyval.decl) = DeclarationNode::newFromTypedef( (yyvsp[(2) - (2)].tok) )->addQualifiers( (yyvsp[(1) - (2)].decl) ); } 6958 6957 break; … … 6961 6960 6962 6961 /* Line 1806 of yacc.c */ 6963 #line 14 60"parser.yy"6962 #line 1459 "parser.yy" 6964 6963 { (yyval.decl) = (yyvsp[(1) - (2)].decl)->addQualifiers( (yyvsp[(2) - (2)].decl) ); } 6965 6964 break; … … 6968 6967 6969 6968 /* Line 1806 of yacc.c */ 6970 #line 14 70"parser.yy"6971 { (yyval.decl) = DeclarationNode::newAggregate( (yyvsp[(1) - (4)].aggKey), nullptr, nullptr, (yyvsp[(3) - (4)].decl), true ); }6969 #line 1469 "parser.yy" 6970 { (yyval.decl) = DeclarationNode::newAggregate( (yyvsp[(1) - (4)].aggKey), 0, 0, (yyvsp[(3) - (4)].decl), true ); } 6972 6971 break; 6973 6972 … … 6975 6974 6976 6975 /* Line 1806 of yacc.c */ 6977 #line 147 2"parser.yy"6976 #line 1471 "parser.yy" 6978 6977 { 6979 6978 typedefTable.makeTypedef( *(yyvsp[(2) - (2)].tok) ); 6980 (yyval.decl) = DeclarationNode::newAggregate( (yyvsp[(1) - (2)].aggKey), (yyvsp[(2) - (2)].tok), nullptr, nullptr, false );6979 (yyval.decl) = DeclarationNode::newAggregate( (yyvsp[(1) - (2)].aggKey), (yyvsp[(2) - (2)].tok), 0, 0, false ); 6981 6980 } 6982 6981 break; … … 6985 6984 6986 6985 /* Line 1806 of yacc.c */ 6987 #line 147 7"parser.yy"6986 #line 1476 "parser.yy" 6988 6987 { typedefTable.makeTypedef( *(yyvsp[(2) - (2)].tok) ); } 6989 6988 break; … … 6992 6991 6993 6992 /* Line 1806 of yacc.c */ 6994 #line 147 9"parser.yy"6995 { (yyval.decl) = DeclarationNode::newAggregate( (yyvsp[(1) - (6)].aggKey), (yyvsp[(2) - (6)].tok), nullptr, (yyvsp[(5) - (6)].decl), true ); }6993 #line 1478 "parser.yy" 6994 { (yyval.decl) = DeclarationNode::newAggregate( (yyvsp[(1) - (6)].aggKey), (yyvsp[(2) - (6)].tok), 0, (yyvsp[(5) - (6)].decl), true ); } 6996 6995 break; 6997 6996 … … 6999 6998 7000 6999 /* Line 1806 of yacc.c */ 7001 #line 148 1"parser.yy"7002 { (yyval.decl) = DeclarationNode::newAggregate( (yyvsp[(1) - (7)].aggKey), nullptr, (yyvsp[(3) - (7)].en), (yyvsp[(6) - (7)].decl), false ); }7000 #line 1480 "parser.yy" 7001 { (yyval.decl) = DeclarationNode::newAggregate( (yyvsp[(1) - (7)].aggKey), 0, (yyvsp[(3) - (7)].en), (yyvsp[(6) - (7)].decl), false ); } 7003 7002 break; 7004 7003 … … 7006 7005 7007 7006 /* Line 1806 of yacc.c */ 7008 #line 148 3"parser.yy"7007 #line 1482 "parser.yy" 7009 7008 { (yyval.decl) = (yyvsp[(2) - (2)].decl); } 7010 7009 break; … … 7013 7012 7014 7013 /* Line 1806 of yacc.c */ 7015 #line 148 8"parser.yy"7014 #line 1487 "parser.yy" 7016 7015 { (yyval.aggKey) = DeclarationNode::Struct; } 7017 7016 break; … … 7020 7019 7021 7020 /* Line 1806 of yacc.c */ 7022 #line 14 90"parser.yy"7021 #line 1489 "parser.yy" 7023 7022 { (yyval.aggKey) = DeclarationNode::Union; } 7024 7023 break; … … 7027 7026 7028 7027 /* Line 1806 of yacc.c */ 7029 #line 149 5"parser.yy"7028 #line 1494 "parser.yy" 7030 7029 { (yyval.decl) = 0; } 7031 7030 break; … … 7034 7033 7035 7034 /* Line 1806 of yacc.c */ 7036 #line 149 7"parser.yy"7035 #line 1496 "parser.yy" 7037 7036 { (yyval.decl) = (yyvsp[(1) - (2)].decl) != 0 ? (yyvsp[(1) - (2)].decl)->appendList( (yyvsp[(2) - (2)].decl) ) : (yyvsp[(2) - (2)].decl); } 7038 7037 break; … … 7041 7040 7042 7041 /* Line 1806 of yacc.c */ 7043 #line 150 3"parser.yy"7042 #line 1502 "parser.yy" 7044 7043 { (yyval.decl) = (yyvsp[(2) - (3)].decl)->set_extension( true ); } 7045 7044 break; … … 7048 7047 7049 7048 /* Line 1806 of yacc.c */ 7050 #line 150 6"parser.yy"7049 #line 1505 "parser.yy" 7051 7050 { // mark all fields in list 7052 7051 for ( DeclarationNode *iter = (yyvsp[(2) - (3)].decl); iter != nullptr; iter = (DeclarationNode *)iter->get_next() ) … … 7059 7058 7060 7059 /* Line 1806 of yacc.c */ 7061 #line 151 6"parser.yy"7060 #line 1515 "parser.yy" 7062 7061 { (yyval.decl) = (yyvsp[(1) - (2)].decl)->addName( (yyvsp[(2) - (2)].tok) ); } 7063 7062 break; … … 7066 7065 7067 7066 /* Line 1806 of yacc.c */ 7068 #line 151 8"parser.yy"7067 #line 1517 "parser.yy" 7069 7068 { (yyval.decl) = (yyvsp[(1) - (3)].decl)->appendList( (yyvsp[(1) - (3)].decl)->cloneType( (yyvsp[(3) - (3)].tok) ) ); } 7070 7069 break; … … 7073 7072 7074 7073 /* Line 1806 of yacc.c */ 7075 #line 15 20"parser.yy"7074 #line 1519 "parser.yy" 7076 7075 { (yyval.decl) = (yyvsp[(1) - (2)].decl)->appendList( (yyvsp[(1) - (2)].decl)->cloneType( 0 ) ); } 7077 7076 break; … … 7080 7079 7081 7080 /* Line 1806 of yacc.c */ 7082 #line 152 5"parser.yy"7081 #line 1524 "parser.yy" 7083 7082 { (yyval.decl) = (yyvsp[(2) - (2)].decl)->addType( (yyvsp[(1) - (2)].decl) ); } 7084 7083 break; … … 7087 7086 7088 7087 /* Line 1806 of yacc.c */ 7089 #line 152 7"parser.yy"7088 #line 1526 "parser.yy" 7090 7089 { (yyval.decl) = (yyvsp[(1) - (4)].decl)->appendList( (yyvsp[(1) - (4)].decl)->cloneBaseType( (yyvsp[(4) - (4)].decl) ) ); } 7091 7090 break; … … 7094 7093 7095 7094 /* Line 1806 of yacc.c */ 7096 #line 153 2"parser.yy"7095 #line 1531 "parser.yy" 7097 7096 { (yyval.decl) = DeclarationNode::newName( 0 ); /* XXX */ } 7098 7097 break; … … 7101 7100 7102 7101 /* Line 1806 of yacc.c */ 7103 #line 153 4"parser.yy"7102 #line 1533 "parser.yy" 7104 7103 { (yyval.decl) = DeclarationNode::newBitfield( (yyvsp[(1) - (1)].en) ); } 7105 7104 break; … … 7108 7107 7109 7108 /* Line 1806 of yacc.c */ 7110 #line 153 7"parser.yy"7109 #line 1536 "parser.yy" 7111 7110 { (yyval.decl) = (yyvsp[(1) - (2)].decl)->addBitfield( (yyvsp[(2) - (2)].en) ); } 7112 7111 break; … … 7115 7114 7116 7115 /* Line 1806 of yacc.c */ 7117 #line 15 40"parser.yy"7116 #line 1539 "parser.yy" 7118 7117 { (yyval.decl) = (yyvsp[(1) - (2)].decl)->addBitfield( (yyvsp[(2) - (2)].en) ); } 7119 7118 break; … … 7122 7121 7123 7122 /* Line 1806 of yacc.c */ 7124 #line 154 6"parser.yy"7123 #line 1545 "parser.yy" 7125 7124 { (yyval.en) = 0; } 7126 7125 break; … … 7129 7128 7130 7129 /* Line 1806 of yacc.c */ 7131 #line 154 8"parser.yy"7130 #line 1547 "parser.yy" 7132 7131 { (yyval.en) = (yyvsp[(1) - (1)].en); } 7133 7132 break; … … 7136 7135 7137 7136 /* Line 1806 of yacc.c */ 7138 #line 155 3"parser.yy"7137 #line 1552 "parser.yy" 7139 7138 { (yyval.en) = (yyvsp[(2) - (2)].en); } 7140 7139 break; … … 7143 7142 7144 7143 /* Line 1806 of yacc.c */ 7145 #line 156 2"parser.yy"7146 { (yyval.decl) = DeclarationNode::newEnum( nullptr, (yyvsp[(3) - (5)].decl) ); }7144 #line 1561 "parser.yy" 7145 { (yyval.decl) = DeclarationNode::newEnum( 0, (yyvsp[(3) - (5)].decl) ); } 7147 7146 break; 7148 7147 … … 7150 7149 7151 7150 /* Line 1806 of yacc.c */ 7152 #line 156 4"parser.yy"7151 #line 1563 "parser.yy" 7153 7152 { 7154 7153 typedefTable.makeTypedef( *(yyvsp[(2) - (2)].tok) ); … … 7160 7159 7161 7160 /* Line 1806 of yacc.c */ 7162 #line 156 9"parser.yy"7161 #line 1568 "parser.yy" 7163 7162 { typedefTable.makeTypedef( *(yyvsp[(2) - (2)].tok) ); } 7164 7163 break; … … 7167 7166 7168 7167 /* Line 1806 of yacc.c */ 7169 #line 157 1"parser.yy"7168 #line 1570 "parser.yy" 7170 7169 { (yyval.decl) = DeclarationNode::newEnum( (yyvsp[(2) - (7)].tok), (yyvsp[(5) - (7)].decl) ); } 7171 7170 break; … … 7174 7173 7175 7174 /* Line 1806 of yacc.c */ 7176 #line 157 6"parser.yy"7175 #line 1575 "parser.yy" 7177 7176 { (yyval.decl) = DeclarationNode::newEnumConstant( (yyvsp[(1) - (2)].tok), (yyvsp[(2) - (2)].en) ); } 7178 7177 break; … … 7181 7180 7182 7181 /* Line 1806 of yacc.c */ 7183 #line 157 8"parser.yy"7182 #line 1577 "parser.yy" 7184 7183 { (yyval.decl) = (yyvsp[(1) - (4)].decl)->appendList( DeclarationNode::newEnumConstant( (yyvsp[(3) - (4)].tok), (yyvsp[(4) - (4)].en) ) ); } 7185 7184 break; … … 7188 7187 7189 7188 /* Line 1806 of yacc.c */ 7190 #line 158 3"parser.yy"7189 #line 1582 "parser.yy" 7191 7190 { (yyval.en) = 0; } 7192 7191 break; … … 7195 7194 7196 7195 /* Line 1806 of yacc.c */ 7197 #line 158 5"parser.yy"7196 #line 1584 "parser.yy" 7198 7197 { (yyval.en) = (yyvsp[(2) - (2)].en); } 7199 7198 break; … … 7202 7201 7203 7202 /* Line 1806 of yacc.c */ 7204 #line 159 2"parser.yy"7203 #line 1591 "parser.yy" 7205 7204 { (yyval.decl) = 0; } 7206 7205 break; … … 7209 7208 7210 7209 /* Line 1806 of yacc.c */ 7211 #line 1 600"parser.yy"7210 #line 1599 "parser.yy" 7212 7211 { (yyval.decl) = (yyvsp[(1) - (5)].decl)->appendList( (yyvsp[(5) - (5)].decl) ); } 7213 7212 break; … … 7216 7215 7217 7216 /* Line 1806 of yacc.c */ 7218 #line 160 2"parser.yy"7217 #line 1601 "parser.yy" 7219 7218 { (yyval.decl) = (yyvsp[(1) - (5)].decl)->addVarArgs(); } 7220 7219 break; … … 7223 7222 7224 7223 /* Line 1806 of yacc.c */ 7225 #line 160 4"parser.yy"7224 #line 1603 "parser.yy" 7226 7225 { (yyval.decl) = (yyvsp[(1) - (5)].decl)->addVarArgs(); } 7227 7226 break; … … 7230 7229 7231 7230 /* Line 1806 of yacc.c */ 7232 #line 161 2"parser.yy"7231 #line 1611 "parser.yy" 7233 7232 { (yyval.decl) = (yyvsp[(1) - (5)].decl)->appendList( (yyvsp[(5) - (5)].decl) ); } 7234 7233 break; … … 7237 7236 7238 7237 /* Line 1806 of yacc.c */ 7239 #line 161 4"parser.yy"7238 #line 1613 "parser.yy" 7240 7239 { (yyval.decl) = (yyvsp[(1) - (5)].decl)->appendList( (yyvsp[(5) - (5)].decl) ); } 7241 7240 break; … … 7244 7243 7245 7244 /* Line 1806 of yacc.c */ 7246 #line 161 6"parser.yy"7245 #line 1615 "parser.yy" 7247 7246 { (yyval.decl) = (yyvsp[(1) - (9)].decl)->appendList( (yyvsp[(5) - (9)].decl) )->appendList( (yyvsp[(9) - (9)].decl) ); } 7248 7247 break; … … 7251 7250 7252 7251 /* Line 1806 of yacc.c */ 7253 #line 162 2"parser.yy"7252 #line 1621 "parser.yy" 7254 7253 { (yyval.decl) = (yyvsp[(1) - (5)].decl)->appendList( (yyvsp[(5) - (5)].decl) ); } 7255 7254 break; … … 7258 7257 7259 7258 /* Line 1806 of yacc.c */ 7260 #line 162 7"parser.yy"7259 #line 1626 "parser.yy" 7261 7260 { (yyval.decl) = 0; } 7262 7261 break; … … 7265 7264 7266 7265 /* Line 1806 of yacc.c */ 7267 #line 163 4"parser.yy"7266 #line 1633 "parser.yy" 7268 7267 { (yyval.decl) = (yyvsp[(1) - (5)].decl)->addVarArgs(); } 7269 7268 break; … … 7272 7271 7273 7272 /* Line 1806 of yacc.c */ 7274 #line 164 1"parser.yy"7273 #line 1640 "parser.yy" 7275 7274 { (yyval.decl) = (yyvsp[(1) - (5)].decl)->appendList( (yyvsp[(5) - (5)].decl) ); } 7276 7275 break; … … 7279 7278 7280 7279 /* Line 1806 of yacc.c */ 7281 #line 164 3"parser.yy"7280 #line 1642 "parser.yy" 7282 7281 { (yyval.decl) = (yyvsp[(1) - (5)].decl)->appendList( (yyvsp[(5) - (5)].decl) ); } 7283 7282 break; … … 7286 7285 7287 7286 /* Line 1806 of yacc.c */ 7288 #line 165 2"parser.yy"7287 #line 1651 "parser.yy" 7289 7288 { (yyval.decl) = (yyvsp[(1) - (3)].decl)->addName( (yyvsp[(2) - (3)].tok) ); } 7290 7289 break; … … 7293 7292 7294 7293 /* Line 1806 of yacc.c */ 7295 #line 165 5"parser.yy"7294 #line 1654 "parser.yy" 7296 7295 { (yyval.decl) = (yyvsp[(1) - (3)].decl)->addName( (yyvsp[(2) - (3)].tok) ); } 7297 7296 break; … … 7300 7299 7301 7300 /* Line 1806 of yacc.c */ 7302 #line 165 7"parser.yy"7301 #line 1656 "parser.yy" 7303 7302 { (yyval.decl) = (yyvsp[(2) - (4)].decl)->addName( (yyvsp[(3) - (4)].tok) )->addQualifiers( (yyvsp[(1) - (4)].decl) ); } 7304 7303 break; … … 7307 7306 7308 7307 /* Line 1806 of yacc.c */ 7309 #line 166 7"parser.yy"7308 #line 1666 "parser.yy" 7310 7309 { (yyval.decl) = (yyvsp[(2) - (2)].decl)->addQualifiers( (yyvsp[(1) - (2)].decl) ); } 7311 7310 break; … … 7314 7313 7315 7314 /* Line 1806 of yacc.c */ 7316 #line 167 3"parser.yy"7315 #line 1672 "parser.yy" 7317 7316 { 7318 7317 typedefTable.addToEnclosingScope( TypedefTable::ID ); … … 7324 7323 7325 7324 /* Line 1806 of yacc.c */ 7326 #line 167 8"parser.yy"7325 #line 1677 "parser.yy" 7327 7326 { 7328 7327 typedefTable.addToEnclosingScope( TypedefTable::ID ); … … 7334 7333 7335 7334 /* Line 1806 of yacc.c */ 7336 #line 168 7"parser.yy"7335 #line 1686 "parser.yy" 7337 7336 { (yyval.decl) = (yyvsp[(2) - (2)].decl)->addType( (yyvsp[(1) - (2)].decl) ); } 7338 7337 break; … … 7341 7340 7342 7341 /* Line 1806 of yacc.c */ 7343 #line 169 6"parser.yy"7342 #line 1695 "parser.yy" 7344 7343 { (yyval.decl) = DeclarationNode::newName( (yyvsp[(1) - (1)].tok) ); } 7345 7344 break; … … 7348 7347 7349 7348 /* Line 1806 of yacc.c */ 7350 #line 169 8"parser.yy"7349 #line 1697 "parser.yy" 7351 7350 { (yyval.decl) = (yyvsp[(1) - (3)].decl)->appendList( DeclarationNode::newName( (yyvsp[(3) - (3)].tok) ) ); } 7352 7351 break; … … 7355 7354 7356 7355 /* Line 1806 of yacc.c */ 7357 #line 172 3"parser.yy"7356 #line 1722 "parser.yy" 7358 7357 { (yyval.decl) = (yyvsp[(2) - (2)].decl)->addType( (yyvsp[(1) - (2)].decl) ); } 7359 7358 break; … … 7362 7361 7363 7362 /* Line 1806 of yacc.c */ 7364 #line 173 1"parser.yy"7363 #line 1730 "parser.yy" 7365 7364 { (yyval.decl) = (yyvsp[(2) - (2)].decl)->addType( (yyvsp[(1) - (2)].decl) ); } 7366 7365 break; … … 7369 7368 7370 7369 /* Line 1806 of yacc.c */ 7371 #line 173 6"parser.yy"7370 #line 1735 "parser.yy" 7372 7371 { (yyval.in) = 0; } 7373 7372 break; … … 7376 7375 7377 7376 /* Line 1806 of yacc.c */ 7378 #line 173 8"parser.yy"7377 #line 1737 "parser.yy" 7379 7378 { (yyval.in) = (yyvsp[(2) - (2)].in); } 7380 7379 break; … … 7383 7382 7384 7383 /* Line 1806 of yacc.c */ 7385 #line 17 40"parser.yy"7384 #line 1739 "parser.yy" 7386 7385 { (yyval.in) = (yyvsp[(2) - (2)].in)->set_maybeConstructed( false ); } 7387 7386 break; … … 7390 7389 7391 7390 /* Line 1806 of yacc.c */ 7391 #line 1743 "parser.yy" 7392 { (yyval.in) = new InitializerNode( (yyvsp[(1) - (1)].en) ); } 7393 break; 7394 7395 case 457: 7396 7397 /* Line 1806 of yacc.c */ 7392 7398 #line 1744 "parser.yy" 7393 { (yyval.in) = new InitializerNode( (yyvsp[(1) - (1)].en) ); }7394 break;7395 7396 case 457:7397 7398 /* Line 1806 of yacc.c */7399 #line 1745 "parser.yy"7400 7399 { (yyval.in) = new InitializerNode( (yyvsp[(2) - (4)].in), true ); } 7401 7400 break; … … 7404 7403 7405 7404 /* Line 1806 of yacc.c */ 7406 #line 17 50"parser.yy"7405 #line 1749 "parser.yy" 7407 7406 { (yyval.in) = 0; } 7408 7407 break; … … 7411 7410 7412 7411 /* Line 1806 of yacc.c */ 7412 #line 1751 "parser.yy" 7413 { (yyval.in) = (yyvsp[(2) - (2)].in)->set_designators( (yyvsp[(1) - (2)].en) ); } 7414 break; 7415 7416 case 461: 7417 7418 /* Line 1806 of yacc.c */ 7413 7419 #line 1752 "parser.yy" 7414 { (yyval.in) = (yyvsp[(2) - (2)].in)->set_designators( (yyvsp[(1) - (2)].en) ); }7415 break;7416 7417 case 461:7418 7419 /* Line 1806 of yacc.c */7420 #line 1753 "parser.yy"7421 7420 { (yyval.in) = (InitializerNode *)( (yyvsp[(1) - (3)].in)->set_last( (yyvsp[(3) - (3)].in) ) ); } 7422 7421 break; … … 7425 7424 7426 7425 /* Line 1806 of yacc.c */ 7427 #line 175 5"parser.yy"7426 #line 1754 "parser.yy" 7428 7427 { (yyval.in) = (InitializerNode *)( (yyvsp[(1) - (4)].in)->set_last( (yyvsp[(4) - (4)].in)->set_designators( (yyvsp[(3) - (4)].en) ) ) ); } 7429 7428 break; … … 7432 7431 7433 7432 /* Line 1806 of yacc.c */ 7434 #line 177 1"parser.yy"7433 #line 1770 "parser.yy" 7435 7434 { (yyval.en) = new ExpressionNode( build_varref( (yyvsp[(1) - (2)].tok) ) ); } 7436 7435 break; … … 7439 7438 7440 7439 /* Line 1806 of yacc.c */ 7441 #line 177 7"parser.yy"7440 #line 1776 "parser.yy" 7442 7441 { (yyval.en) = (ExpressionNode *)( (yyvsp[(1) - (2)].en)->set_last( (yyvsp[(2) - (2)].en) ) ); } 7443 7442 break; … … 7446 7445 7447 7446 /* Line 1806 of yacc.c */ 7448 #line 178 3"parser.yy"7447 #line 1782 "parser.yy" 7449 7448 { (yyval.en) = new ExpressionNode( build_varref( (yyvsp[(2) - (2)].tok) ) ); } 7450 7449 break; … … 7453 7452 7454 7453 /* Line 1806 of yacc.c */ 7455 #line 178 6"parser.yy"7454 #line 1785 "parser.yy" 7456 7455 { (yyval.en) = (yyvsp[(3) - (5)].en); } 7457 7456 break; … … 7460 7459 7461 7460 /* Line 1806 of yacc.c */ 7462 #line 178 8"parser.yy"7461 #line 1787 "parser.yy" 7463 7462 { (yyval.en) = (yyvsp[(3) - (5)].en); } 7464 7463 break; … … 7467 7466 7468 7467 /* Line 1806 of yacc.c */ 7469 #line 17 90"parser.yy"7468 #line 1789 "parser.yy" 7470 7469 { (yyval.en) = new ExpressionNode( build_range( (yyvsp[(3) - (7)].en), (yyvsp[(5) - (7)].en) ) ); } 7471 7470 break; … … 7474 7473 7475 7474 /* Line 1806 of yacc.c */ 7476 #line 179 2"parser.yy"7475 #line 1791 "parser.yy" 7477 7476 { (yyval.en) = (yyvsp[(4) - (6)].en); } 7478 7477 break; … … 7481 7480 7482 7481 /* Line 1806 of yacc.c */ 7483 #line 181 6"parser.yy"7482 #line 1815 "parser.yy" 7484 7483 { (yyval.decl) = (yyvsp[(2) - (2)].decl)->addQualifiers( (yyvsp[(1) - (2)].decl) ); } 7485 7484 break; … … 7488 7487 7489 7488 /* Line 1806 of yacc.c */ 7490 #line 181 8"parser.yy"7489 #line 1817 "parser.yy" 7491 7490 { (yyval.decl) = (yyvsp[(1) - (2)].decl)->addQualifiers( (yyvsp[(2) - (2)].decl) ); } 7492 7491 break; … … 7495 7494 7496 7495 /* Line 1806 of yacc.c */ 7497 #line 18 20"parser.yy"7496 #line 1819 "parser.yy" 7498 7497 { (yyval.decl) = (yyvsp[(1) - (3)].decl)->addQualifiers( (yyvsp[(2) - (3)].decl) )->addQualifiers( (yyvsp[(3) - (3)].decl) ); } 7499 7498 break; … … 7502 7501 7503 7502 /* Line 1806 of yacc.c */ 7504 #line 182 6"parser.yy"7503 #line 1825 "parser.yy" 7505 7504 { (yyval.decl) = (yyvsp[(2) - (2)].decl)->addQualifiers( (yyvsp[(1) - (2)].decl) ); } 7506 7505 break; … … 7509 7508 7510 7509 /* Line 1806 of yacc.c */ 7511 #line 182 8"parser.yy"7510 #line 1827 "parser.yy" 7512 7511 { (yyval.decl) = (yyvsp[(1) - (2)].decl)->addQualifiers( (yyvsp[(2) - (2)].decl) ); } 7513 7512 break; … … 7516 7515 7517 7516 /* Line 1806 of yacc.c */ 7518 #line 183 3"parser.yy"7517 #line 1832 "parser.yy" 7519 7518 { (yyval.decl) = DeclarationNode::newFromTypeGen( (yyvsp[(1) - (4)].tok), (yyvsp[(3) - (4)].en) ); } 7520 7519 break; … … 7523 7522 7524 7523 /* Line 1806 of yacc.c */ 7525 #line 183 9"parser.yy"7524 #line 1838 "parser.yy" 7526 7525 { (yyval.decl) = (yyvsp[(1) - (4)].decl)->appendList( (yyvsp[(3) - (4)].decl) ); } 7527 7526 break; … … 7530 7529 7531 7530 /* Line 1806 of yacc.c */ 7532 #line 184 4"parser.yy"7531 #line 1843 "parser.yy" 7533 7532 { typedefTable.addToEnclosingScope( *(yyvsp[(2) - (2)].tok), TypedefTable::TD ); } 7534 7533 break; … … 7537 7536 7538 7537 /* Line 1806 of yacc.c */ 7539 #line 184 6"parser.yy"7538 #line 1845 "parser.yy" 7540 7539 { (yyval.decl) = DeclarationNode::newTypeParam( (yyvsp[(1) - (4)].tclass), (yyvsp[(2) - (4)].tok) )->addAssertions( (yyvsp[(4) - (4)].decl) ); } 7541 7540 break; … … 7544 7543 7545 7544 /* Line 1806 of yacc.c */ 7546 #line 185 2"parser.yy"7545 #line 1851 "parser.yy" 7547 7546 { (yyval.tclass) = DeclarationNode::Otype; } 7548 7547 break; … … 7551 7550 7552 7551 /* Line 1806 of yacc.c */ 7553 #line 185 4"parser.yy"7552 #line 1853 "parser.yy" 7554 7553 { (yyval.tclass) = DeclarationNode::Ftype; } 7555 7554 break; … … 7558 7557 7559 7558 /* Line 1806 of yacc.c */ 7560 #line 185 6"parser.yy"7559 #line 1855 "parser.yy" 7561 7560 { (yyval.tclass) = DeclarationNode::Dtype; } 7562 7561 break; … … 7565 7564 7566 7565 /* Line 1806 of yacc.c */ 7567 #line 186 1"parser.yy"7566 #line 1860 "parser.yy" 7568 7567 { (yyval.decl) = 0; } 7569 7568 break; … … 7572 7571 7573 7572 /* Line 1806 of yacc.c */ 7574 #line 186 3"parser.yy"7573 #line 1862 "parser.yy" 7575 7574 { (yyval.decl) = (yyvsp[(1) - (2)].decl) != 0 ? (yyvsp[(1) - (2)].decl)->appendList( (yyvsp[(2) - (2)].decl) ) : (yyvsp[(2) - (2)].decl); } 7576 7575 break; … … 7579 7578 7580 7579 /* Line 1806 of yacc.c */ 7581 #line 186 8"parser.yy"7580 #line 1867 "parser.yy" 7582 7581 { 7583 7582 typedefTable.openTrait( *(yyvsp[(2) - (5)].tok) ); … … 7589 7588 7590 7589 /* Line 1806 of yacc.c */ 7591 #line 187 3"parser.yy"7590 #line 1872 "parser.yy" 7592 7591 { (yyval.decl) = (yyvsp[(4) - (5)].decl); } 7593 7592 break; … … 7596 7595 7597 7596 /* Line 1806 of yacc.c */ 7598 #line 187 5"parser.yy"7597 #line 1874 "parser.yy" 7599 7598 { (yyval.decl) = 0; } 7600 7599 break; … … 7603 7602 7604 7603 /* Line 1806 of yacc.c */ 7605 #line 18 80"parser.yy"7604 #line 1879 "parser.yy" 7606 7605 { (yyval.en) = new ExpressionNode( build_typevalue( (yyvsp[(1) - (1)].decl) ) ); } 7607 7606 break; … … 7610 7609 7611 7610 /* Line 1806 of yacc.c */ 7612 #line 188 3"parser.yy"7611 #line 1882 "parser.yy" 7613 7612 { (yyval.en) = (ExpressionNode *)( (yyvsp[(1) - (3)].en)->set_last( new ExpressionNode( build_typevalue( (yyvsp[(3) - (3)].decl) ) ) ) ); } 7614 7613 break; … … 7617 7616 7618 7617 /* Line 1806 of yacc.c */ 7619 #line 188 5"parser.yy"7618 #line 1884 "parser.yy" 7620 7619 { (yyval.en) = (ExpressionNode *)( (yyvsp[(1) - (3)].en)->set_last( (yyvsp[(3) - (3)].en) )); } 7621 7620 break; … … 7624 7623 7625 7624 /* Line 1806 of yacc.c */ 7626 #line 18 90"parser.yy"7625 #line 1889 "parser.yy" 7627 7626 { (yyval.decl) = (yyvsp[(2) - (2)].decl); } 7628 7627 break; … … 7631 7630 7632 7631 /* Line 1806 of yacc.c */ 7633 #line 189 2"parser.yy"7632 #line 1891 "parser.yy" 7634 7633 { (yyval.decl) = (yyvsp[(3) - (3)].decl)->addQualifiers( (yyvsp[(1) - (3)].decl) ); } 7635 7634 break; … … 7638 7637 7639 7638 /* Line 1806 of yacc.c */ 7640 #line 189 4"parser.yy"7639 #line 1893 "parser.yy" 7641 7640 { (yyval.decl) = (yyvsp[(1) - (3)].decl)->appendList( (yyvsp[(3) - (3)].decl)->copyStorageClasses( (yyvsp[(1) - (3)].decl) ) ); } 7642 7641 break; … … 7645 7644 7646 7645 /* Line 1806 of yacc.c */ 7647 #line 189 9"parser.yy"7646 #line 1898 "parser.yy" 7648 7647 { (yyval.decl) = (yyvsp[(1) - (2)].decl)->addAssertions( (yyvsp[(2) - (2)].decl) ); } 7649 7648 break; … … 7652 7651 7653 7652 /* Line 1806 of yacc.c */ 7654 #line 190 1"parser.yy"7653 #line 1900 "parser.yy" 7655 7654 { (yyval.decl) = (yyvsp[(1) - (4)].decl)->addAssertions( (yyvsp[(2) - (4)].decl) )->addType( (yyvsp[(4) - (4)].decl) ); } 7656 7655 break; … … 7659 7658 7660 7659 /* Line 1806 of yacc.c */ 7661 #line 190 6"parser.yy"7660 #line 1905 "parser.yy" 7662 7661 { 7663 7662 typedefTable.addToEnclosingScope( *(yyvsp[(1) - (1)].tok), TypedefTable::TD ); … … 7669 7668 7670 7669 /* Line 1806 of yacc.c */ 7671 #line 191 1"parser.yy"7670 #line 1910 "parser.yy" 7672 7671 { 7673 7672 typedefTable.addToEnclosingScope( *(yyvsp[(1) - (6)].tok), TypedefTable::TG ); … … 7679 7678 7680 7679 /* Line 1806 of yacc.c */ 7681 #line 191 9"parser.yy"7680 #line 1918 "parser.yy" 7682 7681 { 7683 7682 typedefTable.addToEnclosingScope( *(yyvsp[(2) - (9)].tok), TypedefTable::ID ); … … 7689 7688 7690 7689 /* Line 1806 of yacc.c */ 7691 #line 192 4"parser.yy"7690 #line 1923 "parser.yy" 7692 7691 { 7693 7692 typedefTable.enterTrait( *(yyvsp[(2) - (8)].tok) ); … … 7699 7698 7700 7699 /* Line 1806 of yacc.c */ 7701 #line 192 9"parser.yy"7700 #line 1928 "parser.yy" 7702 7701 { 7703 7702 typedefTable.leaveTrait(); … … 7710 7709 7711 7710 /* Line 1806 of yacc.c */ 7712 #line 193 9"parser.yy"7711 #line 1938 "parser.yy" 7713 7712 { (yyval.decl) = (yyvsp[(1) - (3)].decl)->appendList( (yyvsp[(3) - (3)].decl) ); } 7714 7713 break; … … 7717 7716 7718 7717 /* Line 1806 of yacc.c */ 7719 #line 194 9"parser.yy"7718 #line 1948 "parser.yy" 7720 7719 { 7721 7720 typedefTable.addToEnclosingScope2( TypedefTable::ID ); … … 7727 7726 7728 7727 /* Line 1806 of yacc.c */ 7729 #line 195 4"parser.yy"7728 #line 1953 "parser.yy" 7730 7729 { 7731 7730 typedefTable.addToEnclosingScope2( TypedefTable::ID ); … … 7737 7736 7738 7737 /* Line 1806 of yacc.c */ 7739 #line 195 9"parser.yy"7738 #line 1958 "parser.yy" 7740 7739 { 7741 7740 typedefTable.addToEnclosingScope2( *(yyvsp[(5) - (5)].tok), TypedefTable::ID ); … … 7747 7746 7748 7747 /* Line 1806 of yacc.c */ 7749 #line 196 7"parser.yy"7748 #line 1966 "parser.yy" 7750 7749 { 7751 7750 typedefTable.addToEnclosingScope2( TypedefTable::ID ); … … 7757 7756 7758 7757 /* Line 1806 of yacc.c */ 7759 #line 197 2"parser.yy"7758 #line 1971 "parser.yy" 7760 7759 { 7761 7760 typedefTable.addToEnclosingScope2( TypedefTable::ID ); … … 7767 7766 7768 7767 /* Line 1806 of yacc.c */ 7769 #line 198 2"parser.yy"7768 #line 1981 "parser.yy" 7770 7769 {} 7771 7770 break; … … 7774 7773 7775 7774 /* Line 1806 of yacc.c */ 7776 #line 198 4"parser.yy"7775 #line 1983 "parser.yy" 7777 7776 { parseTree = parseTree != nullptr ? parseTree->appendList( (yyvsp[(1) - (1)].decl) ) : (yyvsp[(1) - (1)].decl); } 7778 7777 break; … … 7781 7780 7782 7781 /* Line 1806 of yacc.c */ 7783 #line 19 90"parser.yy"7782 #line 1989 "parser.yy" 7784 7783 { (yyval.decl) = (yyvsp[(1) - (3)].decl) != nullptr ? (yyvsp[(1) - (3)].decl)->appendList( (yyvsp[(3) - (3)].decl) ) : (yyvsp[(3) - (3)].decl); } 7785 7784 break; … … 7788 7787 7789 7788 /* Line 1806 of yacc.c */ 7790 #line 199 5"parser.yy"7789 #line 1994 "parser.yy" 7791 7790 { (yyval.decl) = 0; } 7792 7791 break; … … 7795 7794 7796 7795 /* Line 1806 of yacc.c */ 7797 #line 200 3"parser.yy"7796 #line 2002 "parser.yy" 7798 7797 {} 7799 7798 break; … … 7802 7801 7803 7802 /* Line 1806 of yacc.c */ 7804 #line 200 5"parser.yy"7803 #line 2004 "parser.yy" 7805 7804 { 7806 7805 linkageStack.push( linkage ); // handle nested extern "C"/"Cforall" … … 7812 7811 7813 7812 /* Line 1806 of yacc.c */ 7814 #line 20 10"parser.yy"7813 #line 2009 "parser.yy" 7815 7814 { 7816 7815 linkage = linkageStack.top(); … … 7823 7822 7824 7823 /* Line 1806 of yacc.c */ 7825 #line 201 6"parser.yy"7824 #line 2015 "parser.yy" 7826 7825 { // mark all fields in list 7827 7826 for ( DeclarationNode *iter = (yyvsp[(2) - (2)].decl); iter != nullptr; iter = (DeclarationNode *)iter->get_next() ) … … 7834 7833 7835 7834 /* Line 1806 of yacc.c */ 7836 #line 203 1"parser.yy"7835 #line 2030 "parser.yy" 7837 7836 { 7838 7837 typedefTable.addToEnclosingScope( TypedefTable::ID ); … … 7845 7844 7846 7845 /* Line 1806 of yacc.c */ 7847 #line 203 7"parser.yy"7846 #line 2036 "parser.yy" 7848 7847 { 7849 7848 typedefTable.addToEnclosingScope( TypedefTable::ID ); … … 7856 7855 7857 7856 /* Line 1806 of yacc.c */ 7858 #line 204 6"parser.yy"7857 #line 2045 "parser.yy" 7859 7858 { 7860 7859 typedefTable.addToEnclosingScope( TypedefTable::ID ); … … 7867 7866 7868 7867 /* Line 1806 of yacc.c */ 7869 #line 205 2"parser.yy"7868 #line 2051 "parser.yy" 7870 7869 { 7871 7870 typedefTable.addToEnclosingScope( TypedefTable::ID ); … … 7878 7877 7879 7878 /* Line 1806 of yacc.c */ 7880 #line 205 8"parser.yy"7879 #line 2057 "parser.yy" 7881 7880 { 7882 7881 typedefTable.addToEnclosingScope( TypedefTable::ID ); … … 7889 7888 7890 7889 /* Line 1806 of yacc.c */ 7891 #line 206 4"parser.yy"7890 #line 2063 "parser.yy" 7892 7891 { 7893 7892 typedefTable.addToEnclosingScope( TypedefTable::ID ); … … 7900 7899 7901 7900 /* Line 1806 of yacc.c */ 7902 #line 20 70"parser.yy"7901 #line 2069 "parser.yy" 7903 7902 { 7904 7903 typedefTable.addToEnclosingScope( TypedefTable::ID ); … … 7911 7910 7912 7911 /* Line 1806 of yacc.c */ 7913 #line 207 8"parser.yy"7912 #line 2077 "parser.yy" 7914 7913 { 7915 7914 typedefTable.addToEnclosingScope( TypedefTable::ID ); … … 7922 7921 7923 7922 /* Line 1806 of yacc.c */ 7924 #line 208 4"parser.yy"7923 #line 2083 "parser.yy" 7925 7924 { 7926 7925 typedefTable.addToEnclosingScope( TypedefTable::ID ); … … 7933 7932 7934 7933 /* Line 1806 of yacc.c */ 7935 #line 209 2"parser.yy"7934 #line 2091 "parser.yy" 7936 7935 { 7937 7936 typedefTable.addToEnclosingScope( TypedefTable::ID ); … … 7944 7943 7945 7944 /* Line 1806 of yacc.c */ 7946 #line 209 8"parser.yy"7945 #line 2097 "parser.yy" 7947 7946 { 7948 7947 typedefTable.addToEnclosingScope( TypedefTable::ID ); … … 7955 7954 7956 7955 /* Line 1806 of yacc.c */ 7957 #line 211 3"parser.yy"7956 #line 2112 "parser.yy" 7958 7957 { (yyval.en) = new ExpressionNode( build_range( (yyvsp[(1) - (3)].en), (yyvsp[(3) - (3)].en) ) ); } 7959 7958 break; … … 7962 7961 7963 7962 /* Line 1806 of yacc.c */ 7964 #line 211 8"parser.yy"7963 #line 2117 "parser.yy" 7965 7964 { delete (yyvsp[(3) - (5)].str); } 7966 7965 break; … … 7969 7968 7970 7969 /* Line 1806 of yacc.c */ 7971 #line 212 3"parser.yy"7970 #line 2122 "parser.yy" 7972 7971 { (yyval.decl) = 0; } 7973 7972 break; … … 7976 7975 7977 7976 /* Line 1806 of yacc.c */ 7978 #line 21 30"parser.yy"7977 #line 2129 "parser.yy" 7979 7978 { (yyval.decl) = (yyvsp[(2) - (2)].decl)->addQualifiers( (yyvsp[(1) - (2)].decl) ); } 7980 7979 break; … … 7983 7982 7984 7983 /* Line 1806 of yacc.c */ 7985 #line 213 6"parser.yy"7984 #line 2135 "parser.yy" 7986 7985 { (yyval.decl) = 0; } 7987 7986 break; … … 7990 7989 7991 7990 /* Line 1806 of yacc.c */ 7992 #line 214 7"parser.yy"7991 #line 2146 "parser.yy" 7993 7992 { delete (yyvsp[(3) - (4)].en); } 7994 7993 break; … … 7997 7996 7998 7997 /* Line 1806 of yacc.c */ 7998 #line 2150 "parser.yy" 7999 { delete (yyvsp[(1) - (1)].tok); } 8000 break; 8001 8002 case 557: 8003 8004 /* Line 1806 of yacc.c */ 7999 8005 #line 2151 "parser.yy" 8000 { delete (yyvsp[(1) - (1)]. tok); }8001 break; 8002 8003 case 55 7:8006 { delete (yyvsp[(1) - (1)].decl); } 8007 break; 8008 8009 case 558: 8004 8010 8005 8011 /* Line 1806 of yacc.c */ … … 8008 8014 break; 8009 8015 8010 case 55 8:8016 case 559: 8011 8017 8012 8018 /* Line 1806 of yacc.c */ … … 8015 8021 break; 8016 8022 8017 case 559:8018 8019 /* Line 1806 of yacc.c */8020 #line 2154 "parser.yy"8021 { delete (yyvsp[(1) - (1)].decl); }8022 break;8023 8024 8023 case 560: 8025 8024 8026 8025 /* Line 1806 of yacc.c */ 8027 #line 218 9"parser.yy"8026 #line 2188 "parser.yy" 8028 8027 { (yyval.decl) = (yyvsp[(1) - (2)].decl)->addQualifiers( (yyvsp[(2) - (2)].decl) ); } 8029 8028 break; … … 8032 8031 8033 8032 /* Line 1806 of yacc.c */ 8034 #line 219 2"parser.yy"8033 #line 2191 "parser.yy" 8035 8034 { (yyval.decl) = (yyvsp[(1) - (2)].decl)->addQualifiers( (yyvsp[(2) - (2)].decl) ); } 8036 8035 break; … … 8039 8038 8040 8039 /* Line 1806 of yacc.c */ 8041 #line 219 4"parser.yy"8040 #line 2193 "parser.yy" 8042 8041 { (yyval.decl) = (yyvsp[(1) - (2)].decl)->addQualifiers( (yyvsp[(2) - (2)].decl) ); } 8043 8042 break; … … 8046 8045 8047 8046 /* Line 1806 of yacc.c */ 8048 #line 219 9"parser.yy"8047 #line 2198 "parser.yy" 8049 8048 { 8050 8049 typedefTable.setNextIdentifier( *(yyvsp[(1) - (1)].tok) ); … … 8056 8055 8057 8056 /* Line 1806 of yacc.c */ 8058 #line 220 4"parser.yy"8057 #line 2203 "parser.yy" 8059 8058 { (yyval.decl) = (yyvsp[(2) - (3)].decl); } 8060 8059 break; … … 8063 8062 8064 8063 /* Line 1806 of yacc.c */ 8065 #line 220 9"parser.yy"8064 #line 2208 "parser.yy" 8066 8065 { (yyval.decl) = (yyvsp[(2) - (2)].decl)->addPointer( DeclarationNode::newPointer( 0 ) ); } 8067 8066 break; … … 8070 8069 8071 8070 /* Line 1806 of yacc.c */ 8072 #line 221 1"parser.yy"8071 #line 2210 "parser.yy" 8073 8072 { (yyval.decl) = (yyvsp[(3) - (3)].decl)->addPointer( DeclarationNode::newPointer( (yyvsp[(2) - (3)].decl) ) ); } 8074 8073 break; … … 8077 8076 8078 8077 /* Line 1806 of yacc.c */ 8079 #line 221 3"parser.yy"8078 #line 2212 "parser.yy" 8080 8079 { (yyval.decl) = (yyvsp[(2) - (3)].decl); } 8081 8080 break; … … 8084 8083 8085 8084 /* Line 1806 of yacc.c */ 8086 #line 221 8"parser.yy"8085 #line 2217 "parser.yy" 8087 8086 { (yyval.decl) = (yyvsp[(1) - (2)].decl)->addArray( (yyvsp[(2) - (2)].decl) ); } 8088 8087 break; … … 8091 8090 8092 8091 /* Line 1806 of yacc.c */ 8093 #line 22 20"parser.yy"8092 #line 2219 "parser.yy" 8094 8093 { (yyval.decl) = (yyvsp[(2) - (4)].decl)->addArray( (yyvsp[(4) - (4)].decl) ); } 8095 8094 break; … … 8098 8097 8099 8098 /* Line 1806 of yacc.c */ 8100 #line 222 2"parser.yy"8099 #line 2221 "parser.yy" 8101 8100 { (yyval.decl) = (yyvsp[(2) - (4)].decl)->addArray( (yyvsp[(4) - (4)].decl) ); } 8102 8101 break; … … 8105 8104 8106 8105 /* Line 1806 of yacc.c */ 8107 #line 222 4"parser.yy"8106 #line 2223 "parser.yy" 8108 8107 { (yyval.decl) = (yyvsp[(2) - (3)].decl); } 8109 8108 break; … … 8112 8111 8113 8112 /* Line 1806 of yacc.c */ 8114 #line 222 9"parser.yy"8113 #line 2228 "parser.yy" 8115 8114 { (yyval.decl) = (yyvsp[(2) - (8)].decl)->addParamList( (yyvsp[(6) - (8)].decl) ); } 8116 8115 break; … … 8119 8118 8120 8119 /* Line 1806 of yacc.c */ 8121 #line 223 1"parser.yy"8120 #line 2230 "parser.yy" 8122 8121 { (yyval.decl) = (yyvsp[(2) - (3)].decl); } 8123 8122 break; … … 8126 8125 8127 8126 /* Line 1806 of yacc.c */ 8128 #line 22 40"parser.yy"8127 #line 2239 "parser.yy" 8129 8128 { (yyval.decl) = (yyvsp[(1) - (2)].decl)->addQualifiers( (yyvsp[(2) - (2)].decl) ); } 8130 8129 break; … … 8133 8132 8134 8133 /* Line 1806 of yacc.c */ 8135 #line 224 3"parser.yy"8134 #line 2242 "parser.yy" 8136 8135 { (yyval.decl) = (yyvsp[(1) - (2)].decl)->addQualifiers( (yyvsp[(2) - (2)].decl) ); } 8137 8136 break; … … 8140 8139 8141 8140 /* Line 1806 of yacc.c */ 8142 #line 224 8"parser.yy"8141 #line 2247 "parser.yy" 8143 8142 { (yyval.decl) = (yyvsp[(1) - (6)].decl)->addParamList( (yyvsp[(4) - (6)].decl) ); } 8144 8143 break; … … 8147 8146 8148 8147 /* Line 1806 of yacc.c */ 8149 #line 22 50"parser.yy"8148 #line 2249 "parser.yy" 8150 8149 { (yyval.decl) = (yyvsp[(2) - (8)].decl)->addParamList( (yyvsp[(6) - (8)].decl) ); } 8151 8150 break; … … 8154 8153 8155 8154 /* Line 1806 of yacc.c */ 8156 #line 225 2"parser.yy"8155 #line 2251 "parser.yy" 8157 8156 { (yyval.decl) = (yyvsp[(2) - (3)].decl); } 8158 8157 break; … … 8161 8160 8162 8161 /* Line 1806 of yacc.c */ 8163 #line 225 7"parser.yy"8162 #line 2256 "parser.yy" 8164 8163 { (yyval.decl) = (yyvsp[(2) - (2)].decl)->addPointer( DeclarationNode::newPointer( 0 ) ); } 8165 8164 break; … … 8168 8167 8169 8168 /* Line 1806 of yacc.c */ 8170 #line 225 9"parser.yy"8169 #line 2258 "parser.yy" 8171 8170 { (yyval.decl) = (yyvsp[(3) - (3)].decl)->addPointer( DeclarationNode::newPointer( (yyvsp[(2) - (3)].decl) ) ); } 8172 8171 break; … … 8175 8174 8176 8175 /* Line 1806 of yacc.c */ 8177 #line 226 1"parser.yy"8176 #line 2260 "parser.yy" 8178 8177 { (yyval.decl) = (yyvsp[(2) - (3)].decl); } 8179 8178 break; … … 8182 8181 8183 8182 /* Line 1806 of yacc.c */ 8184 #line 226 6"parser.yy"8183 #line 2265 "parser.yy" 8185 8184 { (yyval.decl) = (yyvsp[(2) - (4)].decl)->addArray( (yyvsp[(4) - (4)].decl) ); } 8186 8185 break; … … 8189 8188 8190 8189 /* Line 1806 of yacc.c */ 8191 #line 226 8"parser.yy"8190 #line 2267 "parser.yy" 8192 8191 { (yyval.decl) = (yyvsp[(2) - (4)].decl)->addArray( (yyvsp[(4) - (4)].decl) ); } 8193 8192 break; … … 8196 8195 8197 8196 /* Line 1806 of yacc.c */ 8198 #line 22 70"parser.yy"8197 #line 2269 "parser.yy" 8199 8198 { (yyval.decl) = (yyvsp[(2) - (3)].decl); } 8200 8199 break; … … 8203 8202 8204 8203 /* Line 1806 of yacc.c */ 8205 #line 228 5"parser.yy"8204 #line 2284 "parser.yy" 8206 8205 { (yyval.decl) = (yyvsp[(1) - (4)].decl)->addIdList( (yyvsp[(3) - (4)].decl) ); } 8207 8206 break; … … 8210 8209 8211 8210 /* Line 1806 of yacc.c */ 8212 #line 228 7"parser.yy"8211 #line 2286 "parser.yy" 8213 8212 { (yyval.decl) = (yyvsp[(2) - (6)].decl)->addIdList( (yyvsp[(5) - (6)].decl) ); } 8214 8213 break; … … 8217 8216 8218 8217 /* Line 1806 of yacc.c */ 8219 #line 228 9"parser.yy"8218 #line 2288 "parser.yy" 8220 8219 { (yyval.decl) = (yyvsp[(2) - (3)].decl); } 8221 8220 break; … … 8224 8223 8225 8224 /* Line 1806 of yacc.c */ 8226 #line 229 4"parser.yy"8225 #line 2293 "parser.yy" 8227 8226 { (yyval.decl) = (yyvsp[(2) - (2)].decl)->addPointer( DeclarationNode::newPointer( 0 ) ); } 8228 8227 break; … … 8231 8230 8232 8231 /* Line 1806 of yacc.c */ 8233 #line 229 6"parser.yy"8232 #line 2295 "parser.yy" 8234 8233 { (yyval.decl) = (yyvsp[(3) - (3)].decl)->addPointer( DeclarationNode::newPointer( (yyvsp[(2) - (3)].decl) ) ); } 8235 8234 break; … … 8238 8237 8239 8238 /* Line 1806 of yacc.c */ 8240 #line 229 8"parser.yy"8239 #line 2297 "parser.yy" 8241 8240 { (yyval.decl) = (yyvsp[(2) - (3)].decl); } 8242 8241 break; … … 8245 8244 8246 8245 /* Line 1806 of yacc.c */ 8247 #line 230 3"parser.yy"8246 #line 2302 "parser.yy" 8248 8247 { (yyval.decl) = (yyvsp[(2) - (4)].decl)->addArray( (yyvsp[(4) - (4)].decl) ); } 8249 8248 break; … … 8252 8251 8253 8252 /* Line 1806 of yacc.c */ 8254 #line 230 5"parser.yy"8253 #line 2304 "parser.yy" 8255 8254 { (yyval.decl) = (yyvsp[(2) - (4)].decl)->addArray( (yyvsp[(4) - (4)].decl) ); } 8256 8255 break; … … 8259 8258 8260 8259 /* Line 1806 of yacc.c */ 8261 #line 230 7"parser.yy"8260 #line 2306 "parser.yy" 8262 8261 { (yyval.decl) = (yyvsp[(2) - (3)].decl); } 8263 8262 break; … … 8266 8265 8267 8266 /* Line 1806 of yacc.c */ 8268 #line 232 2"parser.yy"8267 #line 2321 "parser.yy" 8269 8268 { (yyval.decl) = (yyvsp[(1) - (2)].decl)->addQualifiers( (yyvsp[(2) - (2)].decl) ); } 8270 8269 break; … … 8273 8272 8274 8273 /* Line 1806 of yacc.c */ 8275 #line 232 5"parser.yy"8274 #line 2324 "parser.yy" 8276 8275 { (yyval.decl) = (yyvsp[(1) - (2)].decl)->addQualifiers( (yyvsp[(2) - (2)].decl) ); } 8277 8276 break; … … 8280 8279 8281 8280 /* Line 1806 of yacc.c */ 8282 #line 232 7"parser.yy"8281 #line 2326 "parser.yy" 8283 8282 { (yyval.decl) = (yyvsp[(1) - (2)].decl)->addQualifiers( (yyvsp[(2) - (2)].decl) ); } 8284 8283 break; … … 8287 8286 8288 8287 /* Line 1806 of yacc.c */ 8289 #line 233 3"parser.yy"8288 #line 2332 "parser.yy" 8290 8289 { (yyval.decl) = (yyvsp[(2) - (3)].decl); } 8291 8290 break; … … 8294 8293 8295 8294 /* Line 1806 of yacc.c */ 8296 #line 233 8"parser.yy"8295 #line 2337 "parser.yy" 8297 8296 { (yyval.decl) = (yyvsp[(2) - (2)].decl)->addPointer( DeclarationNode::newPointer( 0 ) ); } 8298 8297 break; … … 8301 8300 8302 8301 /* Line 1806 of yacc.c */ 8303 #line 23 40"parser.yy"8302 #line 2339 "parser.yy" 8304 8303 { (yyval.decl) = (yyvsp[(3) - (3)].decl)->addPointer( DeclarationNode::newPointer( (yyvsp[(2) - (3)].decl) ) ); } 8305 8304 break; … … 8308 8307 8309 8308 /* Line 1806 of yacc.c */ 8310 #line 234 2"parser.yy"8309 #line 2341 "parser.yy" 8311 8310 { (yyval.decl) = (yyvsp[(2) - (3)].decl); } 8312 8311 break; … … 8315 8314 8316 8315 /* Line 1806 of yacc.c */ 8317 #line 234 7"parser.yy"8316 #line 2346 "parser.yy" 8318 8317 { (yyval.decl) = (yyvsp[(1) - (2)].decl)->addArray( (yyvsp[(2) - (2)].decl) ); } 8319 8318 break; … … 8322 8321 8323 8322 /* Line 1806 of yacc.c */ 8324 #line 234 9"parser.yy"8323 #line 2348 "parser.yy" 8325 8324 { (yyval.decl) = (yyvsp[(2) - (4)].decl)->addArray( (yyvsp[(4) - (4)].decl) ); } 8326 8325 break; … … 8329 8328 8330 8329 /* Line 1806 of yacc.c */ 8331 #line 235 1"parser.yy"8330 #line 2350 "parser.yy" 8332 8331 { (yyval.decl) = (yyvsp[(2) - (4)].decl)->addArray( (yyvsp[(4) - (4)].decl) ); } 8333 8332 break; … … 8336 8335 8337 8336 /* Line 1806 of yacc.c */ 8338 #line 235 3"parser.yy"8337 #line 2352 "parser.yy" 8339 8338 { (yyval.decl) = (yyvsp[(2) - (3)].decl); } 8340 8339 break; … … 8343 8342 8344 8343 /* Line 1806 of yacc.c */ 8345 #line 235 8"parser.yy"8344 #line 2357 "parser.yy" 8346 8345 { (yyval.decl) = (yyvsp[(1) - (6)].decl)->addParamList( (yyvsp[(4) - (6)].decl) ); } 8347 8346 break; … … 8350 8349 8351 8350 /* Line 1806 of yacc.c */ 8352 #line 23 60"parser.yy"8351 #line 2359 "parser.yy" 8353 8352 { (yyval.decl) = (yyvsp[(2) - (8)].decl)->addParamList( (yyvsp[(6) - (8)].decl) ); } 8354 8353 break; … … 8357 8356 8358 8357 /* Line 1806 of yacc.c */ 8359 #line 236 2"parser.yy"8358 #line 2361 "parser.yy" 8360 8359 { (yyval.decl) = (yyvsp[(2) - (3)].decl); } 8361 8360 break; … … 8364 8363 8365 8364 /* Line 1806 of yacc.c */ 8366 #line 237 2"parser.yy"8365 #line 2371 "parser.yy" 8367 8366 { (yyval.decl) = (yyvsp[(1) - (2)].decl)->addQualifiers( (yyvsp[(2) - (2)].decl) ); } 8368 8367 break; … … 8371 8370 8372 8371 /* Line 1806 of yacc.c */ 8373 #line 237 5"parser.yy"8372 #line 2374 "parser.yy" 8374 8373 { (yyval.decl) = (yyvsp[(1) - (2)].decl)->addQualifiers( (yyvsp[(2) - (2)].decl) ); } 8375 8374 break; … … 8378 8377 8379 8378 /* Line 1806 of yacc.c */ 8380 #line 237 7"parser.yy"8379 #line 2376 "parser.yy" 8381 8380 { (yyval.decl) = (yyvsp[(1) - (2)].decl)->addQualifiers( (yyvsp[(2) - (2)].decl) ); } 8382 8381 break; … … 8385 8384 8386 8385 /* Line 1806 of yacc.c */ 8387 #line 238 2"parser.yy"8386 #line 2381 "parser.yy" 8388 8387 { (yyval.decl) = (yyvsp[(2) - (2)].decl)->addPointer( DeclarationNode::newPointer( 0 ) ); } 8389 8388 break; … … 8392 8391 8393 8392 /* Line 1806 of yacc.c */ 8394 #line 238 4"parser.yy"8393 #line 2383 "parser.yy" 8395 8394 { (yyval.decl) = (yyvsp[(3) - (3)].decl)->addPointer( DeclarationNode::newPointer( (yyvsp[(2) - (3)].decl) ) ); } 8396 8395 break; … … 8399 8398 8400 8399 /* Line 1806 of yacc.c */ 8401 #line 238 6"parser.yy"8400 #line 2385 "parser.yy" 8402 8401 { (yyval.decl) = (yyvsp[(2) - (3)].decl); } 8403 8402 break; … … 8406 8405 8407 8406 /* Line 1806 of yacc.c */ 8408 #line 239 1"parser.yy"8407 #line 2390 "parser.yy" 8409 8408 { (yyval.decl) = (yyvsp[(1) - (2)].decl)->addArray( (yyvsp[(2) - (2)].decl) ); } 8410 8409 break; … … 8413 8412 8414 8413 /* Line 1806 of yacc.c */ 8415 #line 239 3"parser.yy"8414 #line 2392 "parser.yy" 8416 8415 { (yyval.decl) = (yyvsp[(2) - (4)].decl)->addArray( (yyvsp[(4) - (4)].decl) ); } 8417 8416 break; … … 8420 8419 8421 8420 /* Line 1806 of yacc.c */ 8422 #line 239 5"parser.yy"8421 #line 2394 "parser.yy" 8423 8422 { (yyval.decl) = (yyvsp[(2) - (4)].decl)->addArray( (yyvsp[(4) - (4)].decl) ); } 8424 8423 break; … … 8427 8426 8428 8427 /* Line 1806 of yacc.c */ 8429 #line 239 7"parser.yy"8428 #line 2396 "parser.yy" 8430 8429 { (yyval.decl) = (yyvsp[(2) - (3)].decl); } 8431 8430 break; … … 8434 8433 8435 8434 /* Line 1806 of yacc.c */ 8436 #line 240 2"parser.yy"8435 #line 2401 "parser.yy" 8437 8436 { (yyval.decl) = (yyvsp[(1) - (6)].decl)->addParamList( (yyvsp[(4) - (6)].decl) ); } 8438 8437 break; … … 8441 8440 8442 8441 /* Line 1806 of yacc.c */ 8443 #line 240 4"parser.yy"8442 #line 2403 "parser.yy" 8444 8443 { (yyval.decl) = (yyvsp[(2) - (8)].decl)->addParamList( (yyvsp[(6) - (8)].decl) ); } 8445 8444 break; … … 8448 8447 8449 8448 /* Line 1806 of yacc.c */ 8450 #line 240 6"parser.yy"8449 #line 2405 "parser.yy" 8451 8450 { (yyval.decl) = (yyvsp[(2) - (3)].decl); } 8452 8451 break; … … 8455 8454 8456 8455 /* Line 1806 of yacc.c */ 8457 #line 243 7"parser.yy"8456 #line 2436 "parser.yy" 8458 8457 { (yyval.decl) = (yyvsp[(1) - (2)].decl)->addQualifiers( (yyvsp[(2) - (2)].decl) ); } 8459 8458 break; … … 8462 8461 8463 8462 /* Line 1806 of yacc.c */ 8464 #line 24 40"parser.yy"8463 #line 2439 "parser.yy" 8465 8464 { (yyval.decl) = (yyvsp[(1) - (2)].decl)->addQualifiers( (yyvsp[(2) - (2)].decl) ); } 8466 8465 break; … … 8469 8468 8470 8469 /* Line 1806 of yacc.c */ 8471 #line 244 2"parser.yy"8470 #line 2441 "parser.yy" 8472 8471 { (yyval.decl) = (yyvsp[(1) - (2)].decl)->addQualifiers( (yyvsp[(2) - (2)].decl) ); } 8473 8472 break; … … 8476 8475 8477 8476 /* Line 1806 of yacc.c */ 8478 #line 244 7"parser.yy"8477 #line 2446 "parser.yy" 8479 8478 { 8480 8479 typedefTable.setNextIdentifier( *(yyvsp[(1) - (1)].tok) ); … … 8486 8485 8487 8486 /* Line 1806 of yacc.c */ 8488 #line 245 2"parser.yy"8487 #line 2451 "parser.yy" 8489 8488 { 8490 8489 typedefTable.setNextIdentifier( *(yyvsp[(1) - (1)].tok) ); … … 8496 8495 8497 8496 /* Line 1806 of yacc.c */ 8498 #line 24 60"parser.yy"8497 #line 2459 "parser.yy" 8499 8498 { (yyval.decl) = (yyvsp[(2) - (2)].decl)->addPointer( DeclarationNode::newPointer( 0 ) ); } 8500 8499 break; … … 8503 8502 8504 8503 /* Line 1806 of yacc.c */ 8505 #line 246 2"parser.yy"8504 #line 2461 "parser.yy" 8506 8505 { (yyval.decl) = (yyvsp[(3) - (3)].decl)->addPointer( DeclarationNode::newPointer( (yyvsp[(2) - (3)].decl) ) ); } 8507 8506 break; … … 8510 8509 8511 8510 /* Line 1806 of yacc.c */ 8512 #line 246 4"parser.yy"8511 #line 2463 "parser.yy" 8513 8512 { (yyval.decl) = (yyvsp[(2) - (3)].decl); } 8514 8513 break; … … 8517 8516 8518 8517 /* Line 1806 of yacc.c */ 8519 #line 246 9"parser.yy"8518 #line 2468 "parser.yy" 8520 8519 { (yyval.decl) = (yyvsp[(1) - (2)].decl)->addArray( (yyvsp[(2) - (2)].decl) ); } 8521 8520 break; … … 8524 8523 8525 8524 /* Line 1806 of yacc.c */ 8526 #line 247 1"parser.yy"8525 #line 2470 "parser.yy" 8527 8526 { (yyval.decl) = (yyvsp[(2) - (4)].decl)->addArray( (yyvsp[(4) - (4)].decl) ); } 8528 8527 break; … … 8531 8530 8532 8531 /* Line 1806 of yacc.c */ 8533 #line 247 6"parser.yy"8532 #line 2475 "parser.yy" 8534 8533 { (yyval.decl) = (yyvsp[(1) - (6)].decl)->addParamList( (yyvsp[(4) - (6)].decl) ); } 8535 8534 break; … … 8538 8537 8539 8538 /* Line 1806 of yacc.c */ 8540 #line 247 8"parser.yy"8539 #line 2477 "parser.yy" 8541 8540 { (yyval.decl) = (yyvsp[(2) - (8)].decl)->addParamList( (yyvsp[(6) - (8)].decl) ); } 8542 8541 break; … … 8545 8544 8546 8545 /* Line 1806 of yacc.c */ 8547 #line 249 3"parser.yy"8546 #line 2492 "parser.yy" 8548 8547 { (yyval.decl) = (yyvsp[(1) - (2)].decl)->addQualifiers( (yyvsp[(2) - (2)].decl) ); } 8549 8548 break; … … 8552 8551 8553 8552 /* Line 1806 of yacc.c */ 8554 #line 249 5"parser.yy"8553 #line 2494 "parser.yy" 8555 8554 { (yyval.decl) = (yyvsp[(1) - (2)].decl)->addQualifiers( (yyvsp[(2) - (2)].decl) ); } 8556 8555 break; … … 8559 8558 8560 8559 /* Line 1806 of yacc.c */ 8561 #line 2 500"parser.yy"8560 #line 2499 "parser.yy" 8562 8561 { (yyval.decl) = DeclarationNode::newPointer( 0 ); } 8563 8562 break; … … 8566 8565 8567 8566 /* Line 1806 of yacc.c */ 8568 #line 250 2"parser.yy"8567 #line 2501 "parser.yy" 8569 8568 { (yyval.decl) = DeclarationNode::newPointer( (yyvsp[(2) - (2)].decl) ); } 8570 8569 break; … … 8573 8572 8574 8573 /* Line 1806 of yacc.c */ 8575 #line 250 4"parser.yy"8574 #line 2503 "parser.yy" 8576 8575 { (yyval.decl) = (yyvsp[(2) - (2)].decl)->addPointer( DeclarationNode::newPointer( 0 ) ); } 8577 8576 break; … … 8580 8579 8581 8580 /* Line 1806 of yacc.c */ 8582 #line 250 6"parser.yy"8581 #line 2505 "parser.yy" 8583 8582 { (yyval.decl) = (yyvsp[(3) - (3)].decl)->addPointer( DeclarationNode::newPointer( (yyvsp[(2) - (3)].decl) ) ); } 8584 8583 break; … … 8587 8586 8588 8587 /* Line 1806 of yacc.c */ 8589 #line 250 8"parser.yy"8588 #line 2507 "parser.yy" 8590 8589 { (yyval.decl) = (yyvsp[(2) - (3)].decl); } 8591 8590 break; … … 8594 8593 8595 8594 /* Line 1806 of yacc.c */ 8596 #line 251 4"parser.yy"8595 #line 2513 "parser.yy" 8597 8596 { (yyval.decl) = (yyvsp[(2) - (4)].decl)->addArray( (yyvsp[(4) - (4)].decl) ); } 8598 8597 break; … … 8601 8600 8602 8601 /* Line 1806 of yacc.c */ 8603 #line 251 6"parser.yy"8602 #line 2515 "parser.yy" 8604 8603 { (yyval.decl) = (yyvsp[(2) - (4)].decl)->addArray( (yyvsp[(4) - (4)].decl) ); } 8605 8604 break; … … 8608 8607 8609 8608 /* Line 1806 of yacc.c */ 8610 #line 251 8"parser.yy"8609 #line 2517 "parser.yy" 8611 8610 { (yyval.decl) = (yyvsp[(2) - (3)].decl); } 8612 8611 break; … … 8615 8614 8616 8615 /* Line 1806 of yacc.c */ 8617 #line 252 3"parser.yy"8618 { (yyval.decl) = DeclarationNode::newFunction( nullptr, nullptr, (yyvsp[(3) - (5)].decl), nullptr); }8616 #line 2522 "parser.yy" 8617 { (yyval.decl) = DeclarationNode::newFunction( 0, 0, (yyvsp[(3) - (5)].decl), 0 ); } 8619 8618 break; 8620 8619 … … 8622 8621 8623 8622 /* Line 1806 of yacc.c */ 8624 #line 252 5"parser.yy"8623 #line 2524 "parser.yy" 8625 8624 { (yyval.decl) = (yyvsp[(2) - (8)].decl)->addParamList( (yyvsp[(6) - (8)].decl) ); } 8626 8625 break; … … 8629 8628 8630 8629 /* Line 1806 of yacc.c */ 8631 #line 252 7"parser.yy"8630 #line 2526 "parser.yy" 8632 8631 { (yyval.decl) = (yyvsp[(2) - (3)].decl); } 8633 8632 break; … … 8636 8635 8637 8636 /* Line 1806 of yacc.c */ 8638 #line 253 3"parser.yy"8637 #line 2532 "parser.yy" 8639 8638 { (yyval.decl) = DeclarationNode::newArray( 0, 0, false ); } 8640 8639 break; … … 8643 8642 8644 8643 /* Line 1806 of yacc.c */ 8645 #line 253 5"parser.yy"8644 #line 2534 "parser.yy" 8646 8645 { (yyval.decl) = DeclarationNode::newArray( 0, 0, false )->addArray( (yyvsp[(3) - (3)].decl) ); } 8647 8646 break; … … 8650 8649 8651 8650 /* Line 1806 of yacc.c */ 8652 #line 254 1"parser.yy"8651 #line 2540 "parser.yy" 8653 8652 { (yyval.decl) = DeclarationNode::newArray( (yyvsp[(3) - (5)].en), 0, false ); } 8654 8653 break; … … 8657 8656 8658 8657 /* Line 1806 of yacc.c */ 8659 #line 254 3"parser.yy"8658 #line 2542 "parser.yy" 8660 8659 { (yyval.decl) = DeclarationNode::newVarArray( 0 ); } 8661 8660 break; … … 8664 8663 8665 8664 /* Line 1806 of yacc.c */ 8666 #line 254 5"parser.yy"8665 #line 2544 "parser.yy" 8667 8666 { (yyval.decl) = (yyvsp[(1) - (6)].decl)->addArray( DeclarationNode::newArray( (yyvsp[(4) - (6)].en), 0, false ) ); } 8668 8667 break; … … 8671 8670 8672 8671 /* Line 1806 of yacc.c */ 8673 #line 254 7"parser.yy"8672 #line 2546 "parser.yy" 8674 8673 { (yyval.decl) = (yyvsp[(1) - (6)].decl)->addArray( DeclarationNode::newVarArray( 0 ) ); } 8675 8674 break; … … 8678 8677 8679 8678 /* Line 1806 of yacc.c */ 8680 #line 256 2"parser.yy"8679 #line 2561 "parser.yy" 8681 8680 { (yyval.decl) = (yyvsp[(1) - (2)].decl)->addQualifiers( (yyvsp[(2) - (2)].decl) ); } 8682 8681 break; … … 8685 8684 8686 8685 /* Line 1806 of yacc.c */ 8687 #line 256 4"parser.yy"8686 #line 2563 "parser.yy" 8688 8687 { (yyval.decl) = (yyvsp[(1) - (2)].decl)->addQualifiers( (yyvsp[(2) - (2)].decl) ); } 8689 8688 break; … … 8692 8691 8693 8692 /* Line 1806 of yacc.c */ 8694 #line 256 9"parser.yy"8693 #line 2568 "parser.yy" 8695 8694 { (yyval.decl) = DeclarationNode::newPointer( 0 ); } 8696 8695 break; … … 8699 8698 8700 8699 /* Line 1806 of yacc.c */ 8701 #line 257 1"parser.yy"8700 #line 2570 "parser.yy" 8702 8701 { (yyval.decl) = DeclarationNode::newPointer( (yyvsp[(2) - (2)].decl) ); } 8703 8702 break; … … 8706 8705 8707 8706 /* Line 1806 of yacc.c */ 8708 #line 257 3"parser.yy"8707 #line 2572 "parser.yy" 8709 8708 { (yyval.decl) = (yyvsp[(2) - (2)].decl)->addPointer( DeclarationNode::newPointer( 0 ) ); } 8710 8709 break; … … 8713 8712 8714 8713 /* Line 1806 of yacc.c */ 8715 #line 257 5"parser.yy"8714 #line 2574 "parser.yy" 8716 8715 { (yyval.decl) = (yyvsp[(3) - (3)].decl)->addPointer( DeclarationNode::newPointer( (yyvsp[(2) - (3)].decl) ) ); } 8717 8716 break; … … 8720 8719 8721 8720 /* Line 1806 of yacc.c */ 8722 #line 257 7"parser.yy"8721 #line 2576 "parser.yy" 8723 8722 { (yyval.decl) = (yyvsp[(2) - (3)].decl); } 8724 8723 break; … … 8727 8726 8728 8727 /* Line 1806 of yacc.c */ 8729 #line 258 3"parser.yy"8728 #line 2582 "parser.yy" 8730 8729 { (yyval.decl) = (yyvsp[(2) - (4)].decl)->addArray( (yyvsp[(4) - (4)].decl) ); } 8731 8730 break; … … 8734 8733 8735 8734 /* Line 1806 of yacc.c */ 8736 #line 258 5"parser.yy"8735 #line 2584 "parser.yy" 8737 8736 { (yyval.decl) = (yyvsp[(2) - (4)].decl)->addArray( (yyvsp[(4) - (4)].decl) ); } 8738 8737 break; … … 8741 8740 8742 8741 /* Line 1806 of yacc.c */ 8743 #line 258 7"parser.yy"8742 #line 2586 "parser.yy" 8744 8743 { (yyval.decl) = (yyvsp[(2) - (3)].decl); } 8745 8744 break; … … 8748 8747 8749 8748 /* Line 1806 of yacc.c */ 8750 #line 259 2"parser.yy"8751 { (yyval.decl) = DeclarationNode::newFunction( nullptr, nullptr, (yyvsp[(3) - (5)].decl), nullptr); }8749 #line 2591 "parser.yy" 8750 { (yyval.decl) = DeclarationNode::newFunction( 0, 0, (yyvsp[(3) - (5)].decl), 0 ); } 8752 8751 break; 8753 8752 … … 8755 8754 8756 8755 /* Line 1806 of yacc.c */ 8757 #line 259 4"parser.yy"8756 #line 2593 "parser.yy" 8758 8757 { (yyval.decl) = (yyvsp[(2) - (8)].decl)->addParamList( (yyvsp[(6) - (8)].decl) ); } 8759 8758 break; … … 8762 8761 8763 8762 /* Line 1806 of yacc.c */ 8764 #line 259 6"parser.yy"8763 #line 2595 "parser.yy" 8765 8764 { (yyval.decl) = (yyvsp[(2) - (3)].decl); } 8766 8765 break; … … 8769 8768 8770 8769 /* Line 1806 of yacc.c */ 8771 #line 260 3"parser.yy"8770 #line 2602 "parser.yy" 8772 8771 { (yyval.decl) = (yyvsp[(1) - (2)].decl)->addArray( (yyvsp[(2) - (2)].decl) ); } 8773 8772 break; … … 8776 8775 8777 8776 /* Line 1806 of yacc.c */ 8778 #line 261 4"parser.yy"8777 #line 2613 "parser.yy" 8779 8778 { (yyval.decl) = DeclarationNode::newArray( 0, 0, false ); } 8780 8779 break; … … 8783 8782 8784 8783 /* Line 1806 of yacc.c */ 8785 #line 261 7"parser.yy"8784 #line 2616 "parser.yy" 8786 8785 { (yyval.decl) = DeclarationNode::newVarArray( (yyvsp[(3) - (6)].decl) ); } 8787 8786 break; … … 8790 8789 8791 8790 /* Line 1806 of yacc.c */ 8792 #line 261 9"parser.yy"8791 #line 2618 "parser.yy" 8793 8792 { (yyval.decl) = DeclarationNode::newArray( 0, (yyvsp[(3) - (5)].decl), false ); } 8794 8793 break; … … 8797 8796 8798 8797 /* Line 1806 of yacc.c */ 8799 #line 262 2"parser.yy"8798 #line 2621 "parser.yy" 8800 8799 { (yyval.decl) = DeclarationNode::newArray( (yyvsp[(4) - (6)].en), (yyvsp[(3) - (6)].decl), false ); } 8801 8800 break; … … 8804 8803 8805 8804 /* Line 1806 of yacc.c */ 8806 #line 262 4"parser.yy"8805 #line 2623 "parser.yy" 8807 8806 { (yyval.decl) = DeclarationNode::newArray( (yyvsp[(5) - (7)].en), (yyvsp[(4) - (7)].decl), true ); } 8808 8807 break; … … 8811 8810 8812 8811 /* Line 1806 of yacc.c */ 8813 #line 262 6"parser.yy"8812 #line 2625 "parser.yy" 8814 8813 { (yyval.decl) = DeclarationNode::newArray( (yyvsp[(5) - (7)].en), (yyvsp[(3) - (7)].decl), true ); } 8815 8814 break; … … 8818 8817 8819 8818 /* Line 1806 of yacc.c */ 8820 #line 26 40"parser.yy"8819 #line 2639 "parser.yy" 8821 8820 { (yyval.decl) = (yyvsp[(1) - (2)].decl)->addQualifiers( (yyvsp[(2) - (2)].decl) ); } 8822 8821 break; … … 8825 8824 8826 8825 /* Line 1806 of yacc.c */ 8827 #line 264 2"parser.yy"8826 #line 2641 "parser.yy" 8828 8827 { (yyval.decl) = (yyvsp[(1) - (2)].decl)->addQualifiers( (yyvsp[(2) - (2)].decl) ); } 8829 8828 break; … … 8832 8831 8833 8832 /* Line 1806 of yacc.c */ 8834 #line 264 7"parser.yy"8833 #line 2646 "parser.yy" 8835 8834 { (yyval.decl) = DeclarationNode::newPointer( 0 ); } 8836 8835 break; … … 8839 8838 8840 8839 /* Line 1806 of yacc.c */ 8841 #line 264 9"parser.yy"8840 #line 2648 "parser.yy" 8842 8841 { (yyval.decl) = DeclarationNode::newPointer( (yyvsp[(2) - (2)].decl) ); } 8843 8842 break; … … 8846 8845 8847 8846 /* Line 1806 of yacc.c */ 8848 #line 265 1"parser.yy"8847 #line 2650 "parser.yy" 8849 8848 { (yyval.decl) = (yyvsp[(2) - (2)].decl)->addPointer( DeclarationNode::newPointer( 0 ) ); } 8850 8849 break; … … 8853 8852 8854 8853 /* Line 1806 of yacc.c */ 8855 #line 265 3"parser.yy"8854 #line 2652 "parser.yy" 8856 8855 { (yyval.decl) = (yyvsp[(3) - (3)].decl)->addPointer( DeclarationNode::newPointer( (yyvsp[(2) - (3)].decl) ) ); } 8857 8856 break; … … 8860 8859 8861 8860 /* Line 1806 of yacc.c */ 8862 #line 265 5"parser.yy"8861 #line 2654 "parser.yy" 8863 8862 { (yyval.decl) = (yyvsp[(2) - (3)].decl); } 8864 8863 break; … … 8867 8866 8868 8867 /* Line 1806 of yacc.c */ 8869 #line 266 1"parser.yy"8868 #line 2660 "parser.yy" 8870 8869 { (yyval.decl) = (yyvsp[(2) - (4)].decl)->addArray( (yyvsp[(4) - (4)].decl) ); } 8871 8870 break; … … 8874 8873 8875 8874 /* Line 1806 of yacc.c */ 8876 #line 266 3"parser.yy"8875 #line 2662 "parser.yy" 8877 8876 { (yyval.decl) = (yyvsp[(2) - (4)].decl)->addArray( (yyvsp[(4) - (4)].decl) ); } 8878 8877 break; … … 8881 8880 8882 8881 /* Line 1806 of yacc.c */ 8883 #line 266 5"parser.yy"8882 #line 2664 "parser.yy" 8884 8883 { (yyval.decl) = (yyvsp[(2) - (3)].decl); } 8885 8884 break; … … 8888 8887 8889 8888 /* Line 1806 of yacc.c */ 8890 #line 26 70"parser.yy"8889 #line 2669 "parser.yy" 8891 8890 { (yyval.decl) = (yyvsp[(2) - (8)].decl)->addParamList( (yyvsp[(6) - (8)].decl) ); } 8892 8891 break; … … 8895 8894 8896 8895 /* Line 1806 of yacc.c */ 8897 #line 267 2"parser.yy"8896 #line 2671 "parser.yy" 8898 8897 { (yyval.decl) = (yyvsp[(2) - (3)].decl); } 8899 8898 break; … … 8902 8901 8903 8902 /* Line 1806 of yacc.c */ 8904 #line 268 2"parser.yy"8903 #line 2681 "parser.yy" 8905 8904 { (yyval.decl) = (yyvsp[(2) - (2)].decl)->addQualifiers( (yyvsp[(1) - (2)].decl) ); } 8906 8905 break; … … 8909 8908 8910 8909 /* Line 1806 of yacc.c */ 8911 #line 269 2"parser.yy"8910 #line 2691 "parser.yy" 8912 8911 { (yyval.decl) = (yyvsp[(2) - (2)].decl)->addNewPointer( DeclarationNode::newPointer( 0 ) ); } 8913 8912 break; … … 8916 8915 8917 8916 /* Line 1806 of yacc.c */ 8918 #line 269 4"parser.yy"8917 #line 2693 "parser.yy" 8919 8918 { (yyval.decl) = (yyvsp[(3) - (3)].decl)->addNewPointer( DeclarationNode::newPointer( (yyvsp[(1) - (3)].decl) ) ); } 8920 8919 break; … … 8923 8922 8924 8923 /* Line 1806 of yacc.c */ 8925 #line 269 6"parser.yy"8924 #line 2695 "parser.yy" 8926 8925 { (yyval.decl) = (yyvsp[(2) - (2)].decl)->addNewPointer( DeclarationNode::newPointer( 0 ) ); } 8927 8926 break; … … 8930 8929 8931 8930 /* Line 1806 of yacc.c */ 8932 #line 269 8"parser.yy"8931 #line 2697 "parser.yy" 8933 8932 { (yyval.decl) = (yyvsp[(3) - (3)].decl)->addNewPointer( DeclarationNode::newPointer( (yyvsp[(1) - (3)].decl) ) ); } 8934 8933 break; … … 8937 8936 8938 8937 /* Line 1806 of yacc.c */ 8939 #line 2 700"parser.yy"8938 #line 2699 "parser.yy" 8940 8939 { (yyval.decl) = (yyvsp[(2) - (2)].decl)->addNewPointer( DeclarationNode::newPointer( 0 ) ); } 8941 8940 break; … … 8944 8943 8945 8944 /* Line 1806 of yacc.c */ 8946 #line 270 2"parser.yy"8945 #line 2701 "parser.yy" 8947 8946 { (yyval.decl) = (yyvsp[(3) - (3)].decl)->addNewPointer( DeclarationNode::newPointer( (yyvsp[(1) - (3)].decl) ) ); } 8948 8947 break; … … 8951 8950 8952 8951 /* Line 1806 of yacc.c */ 8953 #line 270 9"parser.yy"8952 #line 2708 "parser.yy" 8954 8953 { (yyval.decl) = (yyvsp[(3) - (3)].decl)->addNewArray( DeclarationNode::newArray( 0, 0, false ) ); } 8955 8954 break; … … 8958 8957 8959 8958 /* Line 1806 of yacc.c */ 8960 #line 271 1"parser.yy"8959 #line 2710 "parser.yy" 8961 8960 { (yyval.decl) = (yyvsp[(2) - (2)].decl)->addNewArray( (yyvsp[(1) - (2)].decl) ); } 8962 8961 break; … … 8965 8964 8966 8965 /* Line 1806 of yacc.c */ 8967 #line 271 3"parser.yy"8966 #line 2712 "parser.yy" 8968 8967 { (yyval.decl) = (yyvsp[(4) - (4)].decl)->addNewArray( (yyvsp[(3) - (4)].decl) )->addNewArray( DeclarationNode::newArray( 0, 0, false ) ); } 8969 8968 break; … … 8972 8971 8973 8972 /* Line 1806 of yacc.c */ 8974 #line 271 5"parser.yy"8973 #line 2714 "parser.yy" 8975 8974 { (yyval.decl) = (yyvsp[(3) - (3)].decl)->addNewArray( (yyvsp[(2) - (3)].decl) )->addNewArray( (yyvsp[(1) - (3)].decl) ); } 8976 8975 break; … … 8979 8978 8980 8979 /* Line 1806 of yacc.c */ 8981 #line 271 7"parser.yy"8980 #line 2716 "parser.yy" 8982 8981 { (yyval.decl) = (yyvsp[(2) - (2)].decl)->addNewArray( (yyvsp[(1) - (2)].decl) ); } 8983 8982 break; … … 8986 8985 8987 8986 /* Line 1806 of yacc.c */ 8988 #line 271 9"parser.yy"8987 #line 2718 "parser.yy" 8989 8988 { (yyval.decl) = (yyvsp[(3) - (3)].decl)->addNewArray( DeclarationNode::newArray( 0, 0, false ) ); } 8990 8989 break; … … 8993 8992 8994 8993 /* Line 1806 of yacc.c */ 8995 #line 272 1"parser.yy"8994 #line 2720 "parser.yy" 8996 8995 { (yyval.decl) = (yyvsp[(2) - (2)].decl)->addNewArray( (yyvsp[(1) - (2)].decl) ); } 8997 8996 break; … … 9000 8999 9001 9000 /* Line 1806 of yacc.c */ 9002 #line 272 3"parser.yy"9001 #line 2722 "parser.yy" 9003 9002 { (yyval.decl) = (yyvsp[(4) - (4)].decl)->addNewArray( (yyvsp[(3) - (4)].decl) )->addNewArray( DeclarationNode::newArray( 0, 0, false ) ); } 9004 9003 break; … … 9007 9006 9008 9007 /* Line 1806 of yacc.c */ 9009 #line 272 5"parser.yy"9008 #line 2724 "parser.yy" 9010 9009 { (yyval.decl) = (yyvsp[(3) - (3)].decl)->addNewArray( (yyvsp[(2) - (3)].decl) )->addNewArray( (yyvsp[(1) - (3)].decl) ); } 9011 9010 break; … … 9014 9013 9015 9014 /* Line 1806 of yacc.c */ 9016 #line 272 7"parser.yy"9015 #line 2726 "parser.yy" 9017 9016 { (yyval.decl) = (yyvsp[(2) - (2)].decl)->addNewArray( (yyvsp[(1) - (2)].decl) ); } 9018 9017 break; … … 9021 9020 9022 9021 /* Line 1806 of yacc.c */ 9023 #line 273 2"parser.yy"9022 #line 2731 "parser.yy" 9024 9023 { (yyval.decl) = DeclarationNode::newVarArray( (yyvsp[(3) - (6)].decl) ); } 9025 9024 break; … … 9028 9027 9029 9028 /* Line 1806 of yacc.c */ 9030 #line 273 4"parser.yy"9029 #line 2733 "parser.yy" 9031 9030 { (yyval.decl) = DeclarationNode::newArray( (yyvsp[(4) - (6)].en), (yyvsp[(3) - (6)].decl), false ); } 9032 9031 break; … … 9035 9034 9036 9035 /* Line 1806 of yacc.c */ 9037 #line 273 9"parser.yy"9036 #line 2738 "parser.yy" 9038 9037 { (yyval.decl) = DeclarationNode::newArray( (yyvsp[(4) - (6)].en), (yyvsp[(3) - (6)].decl), true ); } 9039 9038 break; … … 9042 9041 9043 9042 /* Line 1806 of yacc.c */ 9044 #line 274 1"parser.yy"9043 #line 2740 "parser.yy" 9045 9044 { (yyval.decl) = DeclarationNode::newArray( (yyvsp[(5) - (7)].en), (yyvsp[(4) - (7)].decl)->addQualifiers( (yyvsp[(3) - (7)].decl) ), true ); } 9046 9045 break; … … 9049 9048 9050 9049 /* Line 1806 of yacc.c */ 9051 #line 276 8"parser.yy"9050 #line 2767 "parser.yy" 9052 9051 { (yyval.decl) = (yyvsp[(2) - (2)].decl)->addQualifiers( (yyvsp[(1) - (2)].decl) ); } 9053 9052 break; … … 9056 9055 9057 9056 /* Line 1806 of yacc.c */ 9058 #line 277 9"parser.yy"9057 #line 2778 "parser.yy" 9059 9058 { (yyval.decl) = (yyvsp[(2) - (2)].decl)->addNewPointer( DeclarationNode::newPointer( 0 ) ); } 9060 9059 break; … … 9063 9062 9064 9063 /* Line 1806 of yacc.c */ 9065 #line 278 1"parser.yy"9064 #line 2780 "parser.yy" 9066 9065 { (yyval.decl) = (yyvsp[(3) - (3)].decl)->addNewPointer( DeclarationNode::newPointer( (yyvsp[(1) - (3)].decl) ) ); } 9067 9066 break; … … 9070 9069 9071 9070 /* Line 1806 of yacc.c */ 9072 #line 278 3"parser.yy"9071 #line 2782 "parser.yy" 9073 9072 { (yyval.decl) = (yyvsp[(2) - (2)].decl)->addNewPointer( DeclarationNode::newPointer( 0 ) ); } 9074 9073 break; … … 9077 9076 9078 9077 /* Line 1806 of yacc.c */ 9079 #line 278 5"parser.yy"9078 #line 2784 "parser.yy" 9080 9079 { (yyval.decl) = (yyvsp[(3) - (3)].decl)->addNewPointer( DeclarationNode::newPointer( (yyvsp[(1) - (3)].decl) ) ); } 9081 9080 break; … … 9084 9083 9085 9084 /* Line 1806 of yacc.c */ 9086 #line 278 7"parser.yy"9085 #line 2786 "parser.yy" 9087 9086 { (yyval.decl) = (yyvsp[(2) - (2)].decl)->addNewPointer( DeclarationNode::newPointer( 0 ) ); } 9088 9087 break; … … 9091 9090 9092 9091 /* Line 1806 of yacc.c */ 9093 #line 278 9"parser.yy"9092 #line 2788 "parser.yy" 9094 9093 { (yyval.decl) = (yyvsp[(3) - (3)].decl)->addNewPointer( DeclarationNode::newPointer( (yyvsp[(1) - (3)].decl) ) ); } 9095 9094 break; … … 9098 9097 9099 9098 /* Line 1806 of yacc.c */ 9100 #line 279 6"parser.yy"9101 { (yyval.decl) = (yyvsp[(3) - (3)].decl)->addNewArray( DeclarationNode::newArray( nullptr, nullptr, false ) ); }9099 #line 2795 "parser.yy" 9100 { (yyval.decl) = (yyvsp[(3) - (3)].decl)->addNewArray( DeclarationNode::newArray( 0, 0, false ) ); } 9102 9101 break; 9103 9102 … … 9105 9104 9106 9105 /* Line 1806 of yacc.c */ 9107 #line 279 8"parser.yy"9108 { (yyval.decl) = (yyvsp[(4) - (4)].decl)->addNewArray( (yyvsp[(3) - (4)].decl) )->addNewArray( DeclarationNode::newArray( nullptr, nullptr, false ) ); }9106 #line 2797 "parser.yy" 9107 { (yyval.decl) = (yyvsp[(4) - (4)].decl)->addNewArray( (yyvsp[(3) - (4)].decl) )->addNewArray( DeclarationNode::newArray( 0, 0, false ) ); } 9109 9108 break; 9110 9109 … … 9112 9111 9113 9112 /* Line 1806 of yacc.c */ 9114 #line 2 800"parser.yy"9113 #line 2799 "parser.yy" 9115 9114 { (yyval.decl) = (yyvsp[(2) - (2)].decl)->addNewArray( (yyvsp[(1) - (2)].decl) ); } 9116 9115 break; … … 9119 9118 9120 9119 /* Line 1806 of yacc.c */ 9121 #line 280 2"parser.yy"9122 { (yyval.decl) = (yyvsp[(3) - (3)].decl)->addNewArray( DeclarationNode::newArray( nullptr, nullptr, false ) ); }9120 #line 2801 "parser.yy" 9121 { (yyval.decl) = (yyvsp[(3) - (3)].decl)->addNewArray( DeclarationNode::newArray( 0, 0, false ) ); } 9123 9122 break; 9124 9123 … … 9126 9125 9127 9126 /* Line 1806 of yacc.c */ 9128 #line 280 4"parser.yy"9129 { (yyval.decl) = (yyvsp[(4) - (4)].decl)->addNewArray( (yyvsp[(3) - (4)].decl) )->addNewArray( DeclarationNode::newArray( nullptr, nullptr, false ) ); }9127 #line 2803 "parser.yy" 9128 { (yyval.decl) = (yyvsp[(4) - (4)].decl)->addNewArray( (yyvsp[(3) - (4)].decl) )->addNewArray( DeclarationNode::newArray( 0, 0, false ) ); } 9130 9129 break; 9131 9130 … … 9133 9132 9134 9133 /* Line 1806 of yacc.c */ 9135 #line 280 6"parser.yy"9134 #line 2805 "parser.yy" 9136 9135 { (yyval.decl) = (yyvsp[(2) - (2)].decl)->addNewArray( (yyvsp[(1) - (2)].decl) ); } 9137 9136 break; … … 9140 9139 9141 9140 /* Line 1806 of yacc.c */ 9142 #line 281 1"parser.yy"9141 #line 2810 "parser.yy" 9143 9142 { (yyval.decl) = DeclarationNode::newTuple( (yyvsp[(3) - (5)].decl) ); } 9144 9143 break; … … 9147 9146 9148 9147 /* Line 1806 of yacc.c */ 9149 #line 281 6"parser.yy"9150 { (yyval.decl) = DeclarationNode::newFunction( nullptr, DeclarationNode::newTuple( nullptr ), (yyvsp[(4) - (5)].decl), nullptr); }9148 #line 2815 "parser.yy" 9149 { (yyval.decl) = DeclarationNode::newFunction( 0, DeclarationNode::newTuple( 0 ), (yyvsp[(4) - (5)].decl), 0 ); } 9151 9150 break; 9152 9151 … … 9154 9153 9155 9154 /* Line 1806 of yacc.c */ 9156 #line 281 8"parser.yy"9157 { (yyval.decl) = DeclarationNode::newFunction( nullptr, (yyvsp[(1) - (6)].decl), (yyvsp[(4) - (6)].decl), nullptr); }9155 #line 2817 "parser.yy" 9156 { (yyval.decl) = DeclarationNode::newFunction( 0, (yyvsp[(1) - (6)].decl), (yyvsp[(4) - (6)].decl), 0 ); } 9158 9157 break; 9159 9158 … … 9161 9160 9162 9161 /* Line 1806 of yacc.c */ 9163 #line 28 20"parser.yy"9164 { (yyval.decl) = DeclarationNode::newFunction( nullptr, (yyvsp[(1) - (6)].decl), (yyvsp[(4) - (6)].decl), nullptr); }9162 #line 2819 "parser.yy" 9163 { (yyval.decl) = DeclarationNode::newFunction( 0, (yyvsp[(1) - (6)].decl), (yyvsp[(4) - (6)].decl), 0 ); } 9165 9164 break; 9166 9165 … … 9168 9167 9169 9168 /* Line 1806 of yacc.c */ 9170 #line 284 4"parser.yy"9169 #line 2843 "parser.yy" 9171 9170 { (yyval.en) = 0; } 9172 9171 break; … … 9175 9174 9176 9175 /* Line 1806 of yacc.c */ 9177 #line 284 6"parser.yy"9176 #line 2845 "parser.yy" 9178 9177 { (yyval.en) = (yyvsp[(2) - (2)].en); } 9179 9178 break; … … 9182 9181 9183 9182 /* Line 1806 of yacc.c */ 9184 #line 918 5"Parser/parser.cc"9183 #line 9184 "Parser/parser.cc" 9185 9184 default: break; 9186 9185 } … … 9413 9412 9414 9413 /* Line 2067 of yacc.c */ 9415 #line 284 9"parser.yy"9414 #line 2848 "parser.yy" 9416 9415 9417 9416 // ----end of grammar---- … … 9420 9419 9421 9420 void yyerror( const char * ) { 9422 cout << "Error ";9421 std::cout << "Error "; 9423 9422 if ( yyfilename ) { 9424 cout << "in file " << yyfilename << " ";9423 std::cout << "in file " << yyfilename << " "; 9425 9424 } // if 9426 cout << "at line " << yylineno << " reading token \"" << (yytext[0] == '\0' ? "EOF" : yytext) << "\"" <<endl;9425 std::cout << "at line " << yylineno << " reading token \"" << (yytext[0] == '\0' ? "EOF" : yytext) << "\"" << std::endl; 9427 9426 } 9428 9427 -
src/Parser/parser.h
raee7e35 r7b69174 262 262 263 263 /* Line 2068 of yacc.c */ 264 #line 11 6"parser.yy"264 #line 115 "parser.yy" 265 265 266 266 Token tok; -
src/Parser/parser.yy
raee7e35 r7b69174 10 10 // Created On : Sat Sep 1 20:22:55 2001 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Sat Sep 24 12:16:53201613 // Update Count : 19 9212 // Last Modified On : Mon Sep 12 17:29:45 2016 13 // Update Count : 1969 14 14 // 15 15 … … 54 54 #include "TypeData.h" 55 55 #include "LinkageSpec.h" 56 using namespace std;57 56 58 57 extern DeclarationNode * parseTree; … … 60 59 extern TypedefTable typedefTable; 61 60 62 st ack< LinkageSpec::Spec > linkageStack;63 64 void appendStr( st ring *to,string *from ) {61 std::stack< LinkageSpec::Spec > linkageStack; 62 63 void appendStr( std::string *to, std::string *from ) { 65 64 // "abc" "def" "ghi" => "abcdefghi", remove new text from quotes and insert before last quote in old string. 66 65 to->insert( to->length() - 1, from->substr( 1, from->length() - 2 ) ); … … 360 359 { $$ = $2; } 361 360 | '(' compound_statement ')' // GCC, lambda expression 362 { $$ = new ExpressionNode( build_valexpr( $2 ) ); }361 { $$ = new ExpressionNode( build_valexpr( $2 ) ); } 363 362 ; 364 363 … … 390 389 { 391 390 Token fn; 392 fn.str = new std::string( "?{}" ); // location undefined - use location of '{'?391 fn.str = new std::string( "?{}" ); // location undefined - use location of '{'? 393 392 $$ = new ExpressionNode( new ConstructorExpr( build_func( new ExpressionNode( build_varref( fn ) ), (ExpressionNode *)( $1 )->set_last( $3 ) ) ) ); 394 393 } … … 667 666 { 668 667 Token fn; 669 fn.str = new st ring( "^?{}" );// location undefined668 fn.str = new std::string( "^?{}" ); // location undefined 670 669 $$ = new StatementNode( build_expr( new ExpressionNode( build_func( new ExpressionNode( build_varref( fn ) ), (ExpressionNode *)( $2 )->set_last( $4 ) ) ) ) ); 671 670 } … … 897 896 { $$ = new StatementNode( build_catch( $5, $8 ) ); } 898 897 | handler_clause CATCH '(' push push exception_declaration pop ')' compound_statement pop 899 { $$ = (StatementNode *)$1->set_last( new StatementNode( build_catch( $6, $9 ) ) ); }898 { $$ = (StatementNode *)$1->set_last( new StatementNode( build_catch( $6, $9 ) ) ); } 900 899 | CATCHRESUME '(' push push exception_declaration pop ')' compound_statement pop 901 900 { $$ = new StatementNode( build_catch( $5, $8 ) ); } … … 969 968 { $$ = new ExpressionNode( build_asmexpr( 0, $1, $3 ) ); } 970 969 | '[' constant_expression ']' string_literal '(' constant_expression ')' 971 { $$ = new ExpressionNode( build_asmexpr( $2, $4, $6 ) ); }970 { $$ = new ExpressionNode( build_asmexpr( $2, $4, $6 ) ); } 972 971 ; 973 972 … … 1468 1467 aggregate_name: 1469 1468 aggregate_key '{' field_declaration_list '}' 1470 { $$ = DeclarationNode::newAggregate( $1, nullptr, nullptr, $3, true ); }1469 { $$ = DeclarationNode::newAggregate( $1, 0, 0, $3, true ); } 1471 1470 | aggregate_key no_attr_identifier_or_type_name 1472 1471 { 1473 1472 typedefTable.makeTypedef( *$2 ); 1474 $$ = DeclarationNode::newAggregate( $1, $2, nullptr, nullptr, false );1473 $$ = DeclarationNode::newAggregate( $1, $2, 0, 0, false ); 1475 1474 } 1476 1475 | aggregate_key no_attr_identifier_or_type_name 1477 1476 { typedefTable.makeTypedef( *$2 ); } 1478 1477 '{' field_declaration_list '}' 1479 { $$ = DeclarationNode::newAggregate( $1, $2, nullptr, $5, true ); }1478 { $$ = DeclarationNode::newAggregate( $1, $2, 0, $5, true ); } 1480 1479 | aggregate_key '(' type_name_list ')' '{' field_declaration_list '}' // CFA 1481 { $$ = DeclarationNode::newAggregate( $1, nullptr, $3, $6, false ); }1480 { $$ = DeclarationNode::newAggregate( $1, 0, $3, $6, false ); } 1482 1481 | aggregate_key typegen_name // CFA, S/R conflict 1483 1482 { $$ = $2; } … … 1560 1559 enum_name: 1561 1560 enum_key '{' enumerator_list comma_opt '}' 1562 { $$ = DeclarationNode::newEnum( nullptr, $3 ); }1561 { $$ = DeclarationNode::newEnum( 0, $3 ); } 1563 1562 | enum_key no_attr_identifier_or_type_name 1564 1563 { … … 2521 2520 abstract_function: 2522 2521 '(' push parameter_type_list_opt pop ')' // empty parameter list OBSOLESCENT (see 3) 2523 { $$ = DeclarationNode::newFunction( nullptr, nullptr, $3, nullptr); }2522 { $$ = DeclarationNode::newFunction( 0, 0, $3, 0 ); } 2524 2523 | '(' abstract_ptr ')' '(' push parameter_type_list_opt pop ')' // empty parameter list OBSOLESCENT (see 3) 2525 2524 { $$ = $2->addParamList( $6 ); } … … 2590 2589 abstract_parameter_function: 2591 2590 '(' push parameter_type_list_opt pop ')' // empty parameter list OBSOLESCENT (see 3) 2592 { $$ = DeclarationNode::newFunction( nullptr, nullptr, $3, nullptr); }2591 { $$ = DeclarationNode::newFunction( 0, 0, $3, 0 ); } 2593 2592 | '(' abstract_parameter_ptr ')' '(' push parameter_type_list_opt pop ')' // empty parameter list OBSOLESCENT (see 3) 2594 2593 { $$ = $2->addParamList( $6 ); } … … 2794 2793 // empty (void) function return type. 2795 2794 '[' ']' type_specifier 2796 { $$ = $3->addNewArray( DeclarationNode::newArray( nullptr, nullptr, false ) ); }2795 { $$ = $3->addNewArray( DeclarationNode::newArray( 0, 0, false ) ); } 2797 2796 | '[' ']' multi_array_dimension type_specifier 2798 { $$ = $4->addNewArray( $3 )->addNewArray( DeclarationNode::newArray( nullptr, nullptr, false ) ); }2797 { $$ = $4->addNewArray( $3 )->addNewArray( DeclarationNode::newArray( 0, 0, false ) ); } 2799 2798 | multi_array_dimension type_specifier 2800 2799 { $$ = $2->addNewArray( $1 ); } 2801 2800 | '[' ']' new_abstract_ptr 2802 { $$ = $3->addNewArray( DeclarationNode::newArray( nullptr, nullptr, false ) ); }2801 { $$ = $3->addNewArray( DeclarationNode::newArray( 0, 0, false ) ); } 2803 2802 | '[' ']' multi_array_dimension new_abstract_ptr 2804 { $$ = $4->addNewArray( $3 )->addNewArray( DeclarationNode::newArray( nullptr, nullptr, false ) ); }2803 { $$ = $4->addNewArray( $3 )->addNewArray( DeclarationNode::newArray( 0, 0, false ) ); } 2805 2804 | multi_array_dimension new_abstract_ptr 2806 2805 { $$ = $2->addNewArray( $1 ); } … … 2814 2813 new_abstract_function: // CFA 2815 2814 '[' ']' '(' new_parameter_type_list_opt ')' 2816 { $$ = DeclarationNode::newFunction( nullptr, DeclarationNode::newTuple( nullptr ), $4, nullptr); }2815 { $$ = DeclarationNode::newFunction( 0, DeclarationNode::newTuple( 0 ), $4, 0 ); } 2817 2816 | new_abstract_tuple '(' push new_parameter_type_list_opt pop ')' 2818 { $$ = DeclarationNode::newFunction( nullptr, $1, $4, nullptr); }2817 { $$ = DeclarationNode::newFunction( 0, $1, $4, 0 ); } 2819 2818 | new_function_return '(' push new_parameter_type_list_opt pop ')' 2820 { $$ = DeclarationNode::newFunction( nullptr, $1, $4, nullptr); }2819 { $$ = DeclarationNode::newFunction( 0, $1, $4, 0 ); } 2821 2820 ; 2822 2821 … … 2853 2852 2854 2853 void yyerror( const char * ) { 2855 cout << "Error ";2854 std::cout << "Error "; 2856 2855 if ( yyfilename ) { 2857 cout << "in file " << yyfilename << " ";2856 std::cout << "in file " << yyfilename << " "; 2858 2857 } // if 2859 cout << "at line " << yylineno << " reading token \"" << (yytext[0] == '\0' ? "EOF" : yytext) << "\"" <<endl;2858 std::cout << "at line " << yylineno << " reading token \"" << (yytext[0] == '\0' ? "EOF" : yytext) << "\"" << std::endl; 2860 2859 } 2861 2860 -
src/ResolvExpr/AdjustExprType.cc
raee7e35 r7b69174 37 37 virtual Type* mutate( TupleType *tupleType ); 38 38 virtual Type* mutate( VarArgsType *varArgsType ); 39 virtual Type* mutate( ZeroType *zeroType );40 virtual Type* mutate( OneType *oneType );41 39 42 40 const TypeEnvironment &env; … … 119 117 return varArgsType; 120 118 } 121 122 Type *AdjustExprType::mutate( ZeroType *zeroType ) {123 return zeroType;124 }125 126 Type *AdjustExprType::mutate( OneType *oneType ) {127 return oneType;128 }129 119 } // namespace ResolvExpr 130 120 -
src/ResolvExpr/CommonType.cc
raee7e35 r7b69174 39 39 virtual void visit( TupleType *tupleType ); 40 40 virtual void visit( VarArgsType *varArgsType ); 41 virtual void visit( ZeroType *zeroType );42 virtual void visit( OneType *oneType );43 41 44 42 template< typename RefType > void handleRefType( RefType *inst, Type *other ); … … 136 134 result = new BasicType( basicType->get_qualifiers() + otherBasic->get_qualifiers(), newType ); 137 135 } // if 138 } else if ( dynamic_cast< EnumInstType * > ( type2 ) || dynamic_cast< ZeroType* >( type2 ) || dynamic_cast< OneType* >( type2 ) ) {139 // use signed int in lieu of the enum /zero/onetype136 } else if ( EnumInstType *enumInstType = dynamic_cast< EnumInstType * > ( type2 ) ) { 137 // use signed int in lieu of the enum type 140 138 BasicType::Kind newType = combinedType[ basicType->get_kind() ][ BasicType::SignedInt ]; 141 if ( ( ( newType == basicType->get_kind() && basicType->get_qualifiers() >= type2->get_qualifiers() ) || widenFirst ) && ( ( newType != basicType->get_kind() && basicType->get_qualifiers() <= type2->get_qualifiers() ) || widenSecond ) ) {142 result = new BasicType( basicType->get_qualifiers() + type2->get_qualifiers(), newType );139 if ( ( ( newType == basicType->get_kind() && basicType->get_qualifiers() >= enumInstType->get_qualifiers() ) || widenFirst ) && ( ( newType != basicType->get_kind() && basicType->get_qualifiers() <= enumInstType->get_qualifiers() ) || widenSecond ) ) { 140 result = new BasicType( basicType->get_qualifiers() + enumInstType->get_qualifiers(), newType ); 143 141 } // if 144 142 } // if … … 173 171 otherPointer->get_base()->get_qualifiers() = tq2; 174 172 } // if 175 } else if ( widenSecond && dynamic_cast< ZeroType* >( type2 ) ) {176 result = pointerType->clone();177 result->get_qualifiers() += type2->get_qualifiers();178 173 } // if 179 174 } … … 195 190 196 191 void CommonType::visit( EnumInstType *enumInstType ) { 197 if ( dynamic_cast< BasicType * >( type2 ) || dynamic_cast< ZeroType* >( type2 ) || dynamic_cast< OneType* >( type2 )) {192 if ( dynamic_cast< BasicType * >( type2 ) ) { 198 193 // reuse BasicType, EnumInstType code by swapping type2 with enumInstType 199 194 Type * temp = type2; … … 235 230 void CommonType::visit( VarArgsType *varArgsType ) { 236 231 } 237 238 void CommonType::visit( ZeroType *zeroType ) {239 if ( widenFirst ) {240 if ( dynamic_cast< BasicType* >( type2 ) || dynamic_cast< PointerType* >( type2 ) || dynamic_cast< EnumInstType* >( type2 ) ) {241 if ( widenSecond || zeroType->get_qualifiers() <= type2->get_qualifiers() ) {242 result = type2->clone();243 result->get_qualifiers() += zeroType->get_qualifiers();244 }245 }246 }247 }248 249 void CommonType::visit( OneType *oneType ) {250 if ( widenFirst ) {251 if ( dynamic_cast< BasicType* >( type2 ) || dynamic_cast< EnumInstType* >( type2 ) ) {252 if ( widenSecond || oneType->get_qualifiers() <= type2->get_qualifiers() ) {253 result = type2->clone();254 result->get_qualifiers() += oneType->get_qualifiers();255 }256 }257 }258 }259 232 } // namespace ResolvExpr 260 233 -
src/ResolvExpr/ConversionCost.cc
raee7e35 r7b69174 160 160 // xxx - not positive this is correct, but appears to allow casting int => enum 161 161 cost = Cost( 1, 0, 0 ); 162 } else if ( dynamic_cast< ZeroType* >( dest ) != nullptr || dynamic_cast< OneType* >( dest ) != nullptr ) { 163 cost = Cost( 1, 0, 0 ); 164 } // if 162 } // if 165 163 } 166 164 … … 177 175 } // if 178 176 } // if 179 } else if ( dynamic_cast< ZeroType* >( dest ) != nullptr || dynamic_cast< OneType* >( dest ) != nullptr ) {180 cost = Cost( 1, 0, 0 );181 177 } // if 182 178 } … … 260 256 } 261 257 } 262 263 void ConversionCost::visit(ZeroType *zeroType) {264 if ( dynamic_cast< ZeroType* >( dest ) ) {265 cost = Cost::zero;266 } else if ( BasicType *destAsBasic = dynamic_cast< BasicType* >( dest ) ) {267 // copied from visit(BasicType*) for signed int, but +1 for safe conversions268 int tableResult = costMatrix[ BasicType::SignedInt ][ destAsBasic->get_kind() ];269 if ( tableResult == -1 ) {270 cost = Cost( 1, 0, 0 );271 } else {272 cost = Cost( 0, 0, tableResult + 1 );273 }274 } else if ( dynamic_cast< PointerType* >( dest ) ) {275 cost = Cost( 0, 0, 1 );276 }277 }278 279 void ConversionCost::visit(OneType *oneType) {280 if ( dynamic_cast< OneType* >( dest ) ) {281 cost = Cost::zero;282 } else if ( BasicType *destAsBasic = dynamic_cast< BasicType* >( dest ) ) {283 // copied from visit(BasicType*) for signed int, but +1 for safe conversions284 int tableResult = costMatrix[ BasicType::SignedInt ][ destAsBasic->get_kind() ];285 if ( tableResult == -1 ) {286 cost = Cost( 1, 0, 0 );287 } else {288 cost = Cost( 0, 0, tableResult + 1 );289 }290 }291 }292 258 } // namespace ResolvExpr 293 259 -
src/ResolvExpr/ConversionCost.h
raee7e35 r7b69174 41 41 virtual void visit(TupleType *tupleType); 42 42 virtual void visit(VarArgsType *varArgsType); 43 virtual void visit(ZeroType *zeroType);44 virtual void visit(OneType *oneType);45 43 protected: 46 44 Type *dest; -
src/ResolvExpr/PtrsAssignable.cc
raee7e35 r7b69174 39 39 virtual void visit( TupleType *tupleType ); 40 40 virtual void visit( VarArgsType *varArgsType ); 41 virtual void visit( ZeroType *zeroType );42 virtual void visit( OneType *oneType );43 41 private: 44 42 Type *dest; … … 143 141 void PtrsAssignable::visit( VarArgsType *varArgsType ) { 144 142 } 145 146 void PtrsAssignable::visit( ZeroType *zeroType ) {147 }148 149 void PtrsAssignable::visit( OneType *oneType ) {150 }151 152 143 } // namespace ResolvExpr 153 144 -
src/ResolvExpr/PtrsCastable.cc
raee7e35 r7b69174 40 40 virtual void visit(TupleType *tupleType); 41 41 virtual void visit(VarArgsType *varArgsType); 42 virtual void visit(ZeroType *zeroType);43 virtual void visit(OneType *oneType);44 42 private: 45 43 Type *dest; … … 146 144 result = objectCast( dest, env, indexer ); 147 145 } 148 149 void PtrsCastable::visit(ZeroType *zeroType) {150 result = objectCast( dest, env, indexer );151 }152 153 void PtrsCastable::visit(OneType *oneType) {154 result = objectCast( dest, env, indexer );155 }156 146 } // namespace ResolvExpr 157 147 -
src/ResolvExpr/RenameVars.cc
raee7e35 r7b69174 110 110 } 111 111 112 void RenameVars::visit( ZeroType *zeroType ) {113 typeBefore( zeroType );114 typeAfter( zeroType );115 }116 117 void RenameVars::visit( OneType *oneType ) {118 typeBefore( oneType );119 typeAfter( oneType );120 }121 122 112 void RenameVars::typeBefore( Type *type ) { 123 113 if ( ! type->get_forall().empty() ) { -
src/ResolvExpr/RenameVars.h
raee7e35 r7b69174 44 44 virtual void visit( TupleType *tupleType ); 45 45 virtual void visit( VarArgsType *varArgsType ); 46 virtual void visit( ZeroType *zeroType );47 virtual void visit( OneType *oneType );48 46 49 47 void typeBefore( Type *type ); -
src/ResolvExpr/Resolver.cc
raee7e35 r7b69174 133 133 } else if ( BasicType *bt = dynamic_cast< BasicType * >( type ) ) { 134 134 return bt->isInteger(); 135 } else if ( dynamic_cast< ZeroType* >( type ) != nullptr || dynamic_cast< OneType* >( type ) != nullptr ) {136 return true;137 135 } else { 138 136 return false; … … 461 459 } 462 460 } else { 463 assert( dynamic_cast< BasicType * >( initContext ) || dynamic_cast< PointerType * >( initContext ) 464 || dynamic_cast< ZeroType * >( initContext ) || dynamic_cast< OneType * >( initContext ) ); 461 assert( dynamic_cast< BasicType * >( initContext ) || dynamic_cast< PointerType * >( initContext ) ); 465 462 // basic types are handled here 466 463 Visitor::visit( listInit ); -
src/ResolvExpr/Unify.cc
raee7e35 r7b69174 60 60 virtual void visit(TupleType *tupleType); 61 61 virtual void visit(VarArgsType *varArgsType); 62 virtual void visit(ZeroType *zeroType);63 virtual void visit(OneType *oneType);64 62 65 63 template< typename RefType > void handleRefType( RefType *inst, Type *other ); … … 590 588 } 591 589 592 void Unify::visit(ZeroType *zeroType) {593 result = dynamic_cast< ZeroType* >( type2 );594 }595 596 void Unify::visit(OneType *oneType) {597 result = dynamic_cast< OneType* >( type2 );598 }599 600 590 } // namespace ResolvExpr 601 591 -
src/SymTab/FixFunction.cc
raee7e35 r7b69174 77 77 return varArgsType; 78 78 } 79 80 Type * FixFunction::mutate(ZeroType *zeroType) {81 return zeroType;82 }83 84 Type * FixFunction::mutate(OneType *oneType) {85 return oneType;86 }87 79 } // namespace SymTab 88 80 -
src/SymTab/FixFunction.h
raee7e35 r7b69174 42 42 virtual Type* mutate(TupleType *tupleType); 43 43 virtual Type* mutate(VarArgsType *varArgsType); 44 virtual Type* mutate(ZeroType *zeroType);45 virtual Type* mutate(OneType *oneType);46 44 47 45 bool isVoid; -
src/SymTab/ImplementationType.cc
raee7e35 r7b69174 41 41 virtual void visit(TupleType *tupleType); 42 42 virtual void visit(VarArgsType *varArgsType); 43 virtual void visit(ZeroType *zeroType);44 virtual void visit(OneType *oneType);45 43 46 44 Type *result; // synthesized … … 122 120 void ImplementationType::visit(VarArgsType *varArgsType) { 123 121 } 124 125 void ImplementationType::visit(ZeroType *zeroType) {126 }127 128 void ImplementationType::visit(OneType *oneType) {129 }130 122 } // namespace SymTab 131 123 -
src/SymTab/Mangler.cc
raee7e35 r7b69174 229 229 printQualifiers( varArgsType ); 230 230 mangleName << "VARGS"; 231 }232 233 void Mangler::visit( ZeroType *zeroType ) {234 mangleName << "Z";235 }236 237 void Mangler::visit( OneType *oneType ) {238 mangleName << "O";239 231 } 240 232 -
src/SymTab/Mangler.h
raee7e35 r7b69174 46 46 virtual void visit( TupleType *tupleType ); 47 47 virtual void visit( VarArgsType *varArgsType ); 48 virtual void visit( ZeroType *zeroType );49 virtual void visit( OneType *oneType );50 48 51 49 std::string get_mangleName() { return mangleName.str(); } -
src/SymTab/TypeEquality.cc
raee7e35 r7b69174 42 42 virtual void visit( TypeInstType *typeInst ); 43 43 virtual void visit( VarArgsType *varArgsType ); 44 virtual void visit( ZeroType *zeroType );45 virtual void visit( OneType *oneType );46 44 47 45 void handleQualifiers( Type * t ); … … 201 199 } 202 200 } 203 204 void TypeEquality::visit( ZeroType *zeroType ) {205 handleQualifiers( zeroType );206 if ( ! dynamic_cast< ZeroType * >( other ) ) {207 result = false;208 }209 }210 211 void TypeEquality::visit( OneType *oneType ) {212 handleQualifiers( oneType );213 if ( ! dynamic_cast< OneType * >( other ) ) {214 result = false;215 }216 }217 201 } // namespace SymTab -
src/SynTree/Mutator.cc
raee7e35 r7b69174 453 453 } 454 454 455 Type *Mutator::mutate( ZeroType *zeroType ) {456 mutateAll( zeroType->get_forall(), *this );457 return zeroType;458 }459 460 Type *Mutator::mutate( OneType *oneType ) {461 mutateAll( oneType->get_forall(), *this );462 return oneType;463 }464 465 455 Initializer *Mutator::mutate( SingleInit *singleInit ) { 466 456 singleInit->set_value( singleInit->get_value()->acceptMutator( *this ) ); -
src/SynTree/Mutator.h
raee7e35 r7b69174 95 95 virtual Type* mutate( AttrType *attrType ); 96 96 virtual Type* mutate( VarArgsType *varArgsType ); 97 virtual Type* mutate( ZeroType *zeroType );98 virtual Type* mutate( OneType *oneType );99 97 100 98 virtual Initializer* mutate( SingleInit *singleInit ); -
src/SynTree/SynTree.h
raee7e35 r7b69174 102 102 class AttrType; 103 103 class VarArgsType; 104 class ZeroType;105 class OneType;106 104 107 105 class Initializer; -
src/SynTree/Type.h
raee7e35 r7b69174 418 418 }; 419 419 420 /// Represents a zero constant421 class ZeroType : public Type {422 public:423 ZeroType();424 ZeroType( Type::Qualifiers tq );425 426 virtual ZeroType *clone() const { return new ZeroType( *this ); }427 virtual void accept( Visitor &v ) { v.visit( this ); }428 virtual Type *acceptMutator( Mutator &m ) { return m.mutate( this ); }429 virtual void print( std::ostream &os, int indent = 0 ) const;430 };431 432 /// Represents a one constant433 class OneType : public Type {434 public:435 OneType();436 OneType( Type::Qualifiers tq );437 438 virtual OneType *clone() const { return new OneType( *this ); }439 virtual void accept( Visitor &v ) { v.visit( this ); }440 virtual Type *acceptMutator( Mutator &m ) { return m.mutate( this ); }441 virtual void print( std::ostream &os, int indent = 0 ) const;442 };443 444 420 inline Type::Qualifiers &Type::Qualifiers::operator+=( const Type::Qualifiers &other ) { 445 421 isConst |= other.isConst; -
src/SynTree/TypeSubstitution.cc
raee7e35 r7b69174 179 179 } 180 180 181 Type * TypeSubstitution::mutate( VoidType * voidType ) {182 return handleType( voidType );181 Type * TypeSubstitution::mutate( VoidType *basicType ) { 182 return handleType( basicType ); 183 183 } 184 184 … … 221 221 Type * TypeSubstitution::mutate( VarArgsType *varArgsType ) { 222 222 return handleType( varArgsType ); 223 }224 225 Type * TypeSubstitution::mutate( ZeroType *zeroType ) {226 return handleType( zeroType );227 }228 229 Type * TypeSubstitution::mutate( OneType *oneType ) {230 return handleType( oneType );231 223 } 232 224 -
src/SynTree/TypeSubstitution.h
raee7e35 r7b69174 76 76 virtual Type* mutate(TupleType *tupleType); 77 77 virtual Type* mutate(VarArgsType *varArgsType); 78 virtual Type* mutate(ZeroType *zeroType);79 virtual Type* mutate(OneType *oneType);80 78 81 79 // TODO: worry about traversing into a forall-qualified function type or type decl with assertions -
src/SynTree/Visitor.cc
raee7e35 r7b69174 383 383 } 384 384 385 void Visitor::visit( ZeroType *zeroType ) {386 acceptAll( zeroType->get_forall(), *this );387 }388 389 void Visitor::visit( OneType *oneType ) {390 acceptAll( oneType->get_forall(), *this );391 }392 393 385 void Visitor::visit( SingleInit *singleInit ) { 394 386 singleInit->get_value()->accept( *this ); -
src/SynTree/Visitor.h
raee7e35 r7b69174 95 95 virtual void visit( AttrType *attrType ); 96 96 virtual void visit( VarArgsType *varArgsType ); 97 virtual void visit( ZeroType *zeroType );98 virtual void visit( OneType *oneType );99 97 100 98 virtual void visit( SingleInit *singleInit ); -
src/SynTree/module.mk
raee7e35 r7b69174 26 26 SynTree/AttrType.cc \ 27 27 SynTree/VarArgsType.cc \ 28 SynTree/ZeroOneType.cc \29 28 SynTree/Constant.cc \ 30 29 SynTree/Expression.cc \
Note:
See TracChangeset
for help on using the changeset viewer.