Changeset ea156ae for src/SynTree/Attribute.h
- Timestamp:
- Sep 27, 2017, 5:31:02 PM (7 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, with_gc
- Children:
- 549c006
- Parents:
- 12914e9 (diff), fa16264 (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. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/SynTree/Attribute.h
r12914e9 rea156ae 20 20 #include <string> // for string, operator== 21 21 22 #include "BaseSyntaxNode.h" 23 #include "Mutator.h" 24 #include "Visitor.h" 25 22 26 class Expression; 23 27 24 28 // GCC attribute 25 29 // https://gcc.gnu.org/onlinedocs/gcc-6.1.0/gcc/Attribute-Syntax.html#Attribute-Syntax 26 class Attribute {30 class Attribute : public BaseSyntaxNode { 27 31 public: 32 std::string name; 33 // to keep things nice and tight, use NameExpr for special identifier parameters 34 std::list< Expression * > parameters; 35 28 36 Attribute( std::string name = "", const std::list< Expression * > & parameters = std::list< Expression * >() ) : name( name ), parameters( parameters ) {} 29 37 Attribute( const Attribute &other ); … … 35 43 bool empty() const { return name == ""; } 36 44 37 Attribute * clone() const { return new Attribute( *this ); } 38 void print( std:: ostream &os, int indent = 0 ) const; 39 private: 40 std::string name; 41 // to keep things nice and tight, use NameExpr for special identifier parameters 42 std::list< Expression * > parameters; 45 Attribute * clone() const override { return new Attribute( *this ); } 46 virtual void accept( Visitor & v ) override { v.visit( this ); } 47 virtual Attribute * acceptMutator( Mutator & m ) override { return m.mutate( this ); } 48 virtual void print( std::ostream & os, int indent = 0 ) const override; 43 49 }; 44 50
Note: See TracChangeset
for help on using the changeset viewer.