OPAL (Object Oriented Parallel Accelerator Library)  2.2.0
OPAL
TokenList.cpp
Go to the documentation of this file.
1 // ------------------------------------------------------------------------
2 // $RCSfile: TokenList.cpp,v $
3 // ------------------------------------------------------------------------
4 // $Revision: 1.1.1.1 $
5 // ------------------------------------------------------------------------
6 // Copyright: see Copyright.readme
7 // ------------------------------------------------------------------------
8 //
9 // Class TokenList:
10 // A class used to parse a "token list" attribute.
11 //
12 // ------------------------------------------------------------------------
13 //
14 // $Date: 2000/03/27 09:33:36 $
15 // $Author: Andreas Adelmann $
16 //
17 // ------------------------------------------------------------------------
18 
19 #include "Attributes/TokenList.h"
21 #include "Expressions/SValue.h"
23 
24 using namespace Expressions;
25 
26 
27 // Class TokenList
28 // ------------------------------------------------------------------------
29 
30 namespace Attributes {
31 
32  TokenList::TokenList(const std::string &name, const std::string &help):
33  AttributeHandler(name, help, 0)
34  {}
35 
36 
38  {}
39 
40 
41  const std::string &TokenList::getType() const {
42  static const std::string type("token list");
43  return type;
44  }
45 
46 
47  void TokenList::parse(Attribute &attr, Statement &stat, bool) const {
48  attr.set(new SValue<std::list<Token> >(parseTokenList(stat)));
49  }
50 
51 };
void set(AttributeBase *newBase)
Define new value.
Definition: Attribute.cpp:137
virtual void parse(Attribute &, Statement &, bool) const
Parse the attribute.
Definition: TokenList.cpp:47
virtual const std::string & getType() const
Return attribute type string ``token list&#39;&#39;.
Definition: TokenList.cpp:41
A representation of an Object attribute.
Definition: Attribute.h:55
Interface for statements.
Definition: Statement.h:38
Abstract base class for attribute parsers.
Object attribute with a constant scalar value.
Definition: SValue.h:34
const std::string name
std::list< Token > parseTokenList(Statement &)
Parse a token list (for macro argument and the like).