source: src/SynTree/Attribute.h@ 7bf7fb9

ADT aaron-thesis arm-eh ast-experimental cleanup-dtors ctor deferred_resn demangler enum forall-pointer-decay jacob/cs343-translation jenkins-sandbox memory new-ast new-ast-unique-expr new-env no_list persistent-indexer pthread-emulation qualifiedEnum resolv-new with_gc
Last change on this file since 7bf7fb9 was a436947, checked in by Rob Schluntz <rschlunt@…>, 9 years ago

change type of enumerator to EnumInstType, allow casting between EnumInstType and BasicType, add common type code for EnumInstType and BasicType

  • Property mode set to 100644
File size: 1.3 KB
Line 
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
11// Last Modified By : Rob Schluntz
12// Last Modified On : Fri May 06 16:26:12 2016
13// Update Count : 33
14//
15
16#ifndef GCC_ATTRIBUTE_H
17#define GCC_ATTRIBUTE_H
18
19#include "SynTree.h"
20
21// GCC attribute
22// https://gcc.gnu.org/onlinedocs/gcc-6.1.0/gcc/Attribute-Syntax.html#Attribute-Syntax
23class Attribute {
24 public:
25 Attribute( std::string name = "", const std::list< Expression * > & parameters = std::list< Expression * >() ) : name( name ), parameters( parameters ) {}
26 Attribute( const Attribute &other );
27 virtual ~Attribute();
28
29 std::string get_name() const { return name; }
30 void set_name( const std::string & newValue ) { name = newValue; }
31 std::list< Expression * > & get_parameters() { return parameters; }
32 bool empty() const { return name == ""; }
33
34 Attribute * clone() const { return new Attribute( *this ); }
35 void print( std:: ostream &os, int indent = 0 ) const;
36
37 private:
38 std::string name;
39 // to keep things nice and tight, use NameExpr for special identifier parameters
40 std::list< Expression * > parameters;
41};
42
43#endif
Note: See TracBrowser for help on using the repository browser.