source: src/SynTree/Attribute.h @ ea6332d

aaron-thesisarm-ehcleanup-dtorsdeferred_resndemanglerjacob/cs343-translationjenkins-sandboxnew-astnew-ast-unique-exprnew-envno_listpersistent-indexerresolv-newwith_gc
Last change on this file since ea6332d was ea6332d, checked in by Thierry Delisle <tdelisle@…>, 4 years ago

Big header cleaning pass - commit 3

  • Property mode set to 100644
File size: 1.5 KB
RevLine 
[db175c8]1//
2// Cforall Version 1.0.0 Copyright (C) 2015 University of Waterloo
3//
4// The contents of this file are covered under the licence agreement in the
5// file "LICENCE" distributed with Cforall.
6//
7// Declaration.h --
8//
9// Author           : Richard C. Bilson
10// Created On       : Mon May 18 07:44:20 2015
[44a81853]11// Last Modified By : Peter A. Buhr
[6b0b624]12// Last Modified On : Sat Jul 22 09:54:14 2017
13// Update Count     : 39
[db175c8]14//
15
[6b0b624]16#pragma once
[db175c8]17
[ea6332d]18#include <iosfwd>  // for ostream
19#include <list>    // for list
20#include <string>  // for string, operator==
21
22class Expression;
[db175c8]23
24// GCC attribute
[a436947]25// https://gcc.gnu.org/onlinedocs/gcc-6.1.0/gcc/Attribute-Syntax.html#Attribute-Syntax
[db175c8]26class Attribute {
27  public:
[44a81853]28        Attribute( std::string name = "", const std::list< Expression * > & parameters = std::list< Expression * >() ) : name( name ), parameters( parameters ) {}
29        Attribute( const Attribute &other );
30        virtual ~Attribute();
[db175c8]31
[44a81853]32        std::string get_name() const { return name; }
33        void set_name( const std::string & newValue ) { name = newValue; }
34        std::list< Expression * > & get_parameters() { return parameters; }
35        bool empty() const { return name == ""; }
[db175c8]36
[44a81853]37        Attribute * clone() const { return new Attribute( *this ); }
38        void print( std:: ostream &os, int indent = 0 ) const;
[db175c8]39  private:
[44a81853]40        std::string name;
41        // to keep things nice and tight, use NameExpr for special identifier parameters
42        std::list< Expression * > parameters;
[db175c8]43};
44
[8ca3a72]45const std::list< Attribute * > noAttributes;
46
[44a81853]47// Local Variables: //
48// tab-width: 4 //
49// mode: c++ //
50// compile-command: "make install" //
51// End: //
Note: See TracBrowser for help on using the repository browser.