Changeset 396ee0a for src/SynTree
- Timestamp:
- Feb 22, 2017, 2:42:11 PM (9 years ago)
- Branches:
- ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, stuck-waitfor-destruct, with_gc
- Children:
- 131dbb3, 692de479
- Parents:
- 0788b739 (diff), fc39193 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)links above to see all the changes relative to each parent. - Location:
- src/SynTree
- Files:
-
- 1 added
- 10 edited
-
BaseSyntaxNode.h (added)
-
Declaration.h (modified) (4 diffs)
-
Expression.h (modified) (1 diff)
-
FunctionDecl.cc (modified) (3 diffs)
-
Initializer.h (modified) (1 diff)
-
Mutator.cc (modified) (2 diffs)
-
Mutator.h (modified) (1 diff)
-
Statement.h (modified) (1 diff)
-
Type.h (modified) (1 diff)
-
Visitor.cc (modified) (2 diffs)
-
Visitor.h (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/SynTree/Declaration.h
r0788b739 r396ee0a 10 10 // Created On : Mon May 18 07:44:20 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Thu Feb 9 14:27:08201713 // Update Count : 5 612 // Last Modified On : Thu Feb 16 14:53:35 2017 13 // Update Count : 57 14 14 // 15 15 … … 17 17 #define DECLARATION_H 18 18 19 #include <string> 20 21 #include "BaseSyntaxNode.h" 22 #include "Mutator.h" 23 #include "Visitor.h" 19 24 #include "SynTree.h" 20 #include "Visitor.h"21 #include "Mutator.h"22 25 #include "Parser/LinkageSpec.h" 23 26 #include "Parser/ParseNode.h" 24 #include <string> 25 26 class Declaration { 27 28 class Declaration : public BaseSyntaxNode { 27 29 public: 28 30 Declaration( const std::string &name, DeclarationNode::StorageClass sc, LinkageSpec::Spec linkage ); … … 138 140 CompoundStmt *get_statements() const { return statements; } 139 141 void set_statements( CompoundStmt *newValue ) { statements = newValue; } 140 std::list< std::string >& get_oldIdents() { return oldIdents; }141 std::list< Declaration* >& get_oldDecls() { return oldDecls; }142 142 143 143 virtual FunctionDecl *clone() const { return new FunctionDecl( *this ); } … … 149 149 FunctionType *type; 150 150 CompoundStmt *statements; 151 std::list< std::string > oldIdents;152 std::list< Declaration* > oldDecls;153 151 }; 154 152 -
src/SynTree/Expression.h
r0788b739 r396ee0a 19 19 #include <map> 20 20 #include <memory> 21 22 #include "BaseSyntaxNode.h" 23 #include "Constant.h" 24 #include "Mutator.h" 21 25 #include "SynTree.h" 22 26 #include "Visitor.h" 23 #include "Mutator.h"24 #include "Constant.h"25 27 #include "Common/UniqueName.h" 26 28 27 29 /// Expression is the root type for all expressions 28 class Expression {30 class Expression : public BaseSyntaxNode{ 29 31 public: 30 32 Expression( Expression * _aname = nullptr ); -
src/SynTree/FunctionDecl.cc
r0788b739 r396ee0a 10 10 // Created On : Mon May 18 07:44:20 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Sat Oct 1 23:06:32 201613 // Update Count : 2 112 // Last Modified On : Thu Feb 16 15:01:52 2017 13 // Update Count : 23 14 14 // 15 15 … … 44 44 delete type; 45 45 delete statements; 46 deleteAll( oldDecls );47 46 } 48 47 … … 84 83 } // if 85 84 86 if ( ! oldIdents.empty() ) {87 os << string( indent + 2, ' ' ) << "with parameter names" << endl;88 for ( std::list< std::string >::const_iterator i = oldIdents.begin(); i != oldIdents.end(); ++i ) {89 os << string( indent + 4, ' ' ) << *i << endl;90 } // for91 } // if92 93 if ( ! oldDecls.empty() ) {94 os << string( indent + 2, ' ' ) << "with parameter declarations" << endl;95 printAll( oldDecls, os, indent + 4 );96 } // if97 85 if ( statements ) { 98 86 os << string( indent + 2, ' ' ) << "with body " << endl; -
src/SynTree/Initializer.h
r0788b739 r396ee0a 17 17 #define INITIALIZER_H 18 18 19 #include <cassert> 20 21 #include "BaseSyntaxNode.h" 22 #include "Mutator.h" 19 23 #include "SynTree.h" 24 #include "Type.h" 20 25 #include "Visitor.h" 21 #include "Mutator.h"22 #include "Type.h"23 24 #include <cassert>25 26 26 27 const std::list<Expression*> noDesignators; 27 28 28 29 // Initializer: base class for object initializers (provide default values) 29 class Initializer {30 class Initializer : public BaseSyntaxNode { 30 31 public: 31 32 // Initializer( std::string _name = std::string(""), int _pos = 0 ); -
src/SynTree/Mutator.cc
r0788b739 r396ee0a 10 10 // Created On : Mon May 18 07:44:20 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Thu Feb 9 14:22:56201713 // Update Count : 2 012 // Last Modified On : Thu Feb 16 15:02:23 2017 13 // Update Count : 21 14 14 // 15 15 … … 38 38 DeclarationWithType *Mutator::mutate( FunctionDecl *functionDecl ) { 39 39 functionDecl->set_functionType( maybeMutate( functionDecl->get_functionType(), *this ) ); 40 mutateAll( functionDecl->get_oldDecls(), *this );41 40 functionDecl->set_statements( maybeMutate( functionDecl->get_statements(), *this ) ); 42 41 return functionDecl; -
src/SynTree/Mutator.h
r0788b739 r396ee0a 139 139 } // if 140 140 } catch( SemanticError &e ) { 141 e.set_location( (*i)->location ); 141 142 errors.append( e ); 142 143 } // try -
src/SynTree/Statement.h
r0788b739 r396ee0a 17 17 #define STATEMENT_H 18 18 19 #include "BaseSyntaxNode.h" 20 #include "Label.h" 21 #include "Mutator.h" 19 22 #include "SynTree.h" 23 #include "Type.h" 20 24 #include "Visitor.h" 21 #include "Mutator.h"22 25 #include "Common/SemanticError.h" 23 #include "Type.h" 24 #include "Label.h" 25 26 class Statement { 26 27 class Statement : public BaseSyntaxNode { 27 28 public: 28 29 Statement( std::list<Label> labels ); -
src/SynTree/Type.h
r0788b739 r396ee0a 17 17 #define TYPE_H 18 18 19 #include "BaseSyntaxNode.h" 20 #include "Mutator.h" 19 21 #include "SynTree.h" 20 22 #include "Visitor.h" 21 #include "Mutator.h"22 23 #include "Common/utility.h" 23 24 24 class Type {25 class Type : public BaseSyntaxNode { 25 26 public: 26 27 struct Qualifiers { -
src/SynTree/Visitor.cc
r0788b739 r396ee0a 10 10 // Created On : Mon May 18 07:44:20 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Thu Feb 9 14:19:22201713 // Update Count : 2 212 // Last Modified On : Thu Feb 16 15:01:25 2017 13 // Update Count : 23 14 14 // 15 15 … … 35 35 void Visitor::visit( FunctionDecl *functionDecl ) { 36 36 maybeAccept( functionDecl->get_functionType(), *this ); 37 acceptAll( functionDecl->get_oldDecls(), *this );38 37 maybeAccept( functionDecl->get_statements(), *this ); 39 38 } -
src/SynTree/Visitor.h
r0788b739 r396ee0a 133 133 } 134 134 } catch( SemanticError &e ) { 135 e.set_location( (*i)->location ); 135 136 errors.append( e ); 136 137 } … … 159 160 } // if 160 161 } catch( SemanticError &e ) { 162 e.set_location( (*i)->location ); 161 163 errors.append( e ); 162 164 } // try
Note:
See TracChangeset
for help on using the changeset viewer.