TemplateDefinition.str 1.91 KB
Newer Older
1
/*
2
3
4
 * TemplateDefinition.str:
 * this file is a part of CxxGrammar from the Transformers project.
 * Copyright (C) 2003, 2004  EPITA Research and Development Laboratory.
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 *
 */
david_v's avatar
david_v committed
21
22
23
24
25
26
27
28
module TemplateDefinition

imports

  lib

imports

29
  AsFix
30
  Cxx
david_v's avatar
david_v committed
31
32
33
34
35
36
37
  Identifier
  Kinds
  Parameter
  TemplateDefinitionCandidate

rules

38
  TemplateDefinition : a@|TemplateDeclaration[ Dummy2-opt la1 template la2 < la3 TemplateParameterList la4 > la5 Declaration ]| -> |TemplateDeclaration[ Dummy2-opt la1 template la2 < la3 TemplateParameterList' la4 > la5 Declaration' ]|
39
                       where < begin-scope (!"$template") > a
40
			   ; < begin-scope (!"$template-parameters") > a
41
42
                           ; < resolve > TemplateParameterList => TemplateParameterList'
                           ; < parameters-decl > TemplateParameterList' => l
43
44
                           ; < my-assert (!"$template") > ("$value", <map({x: ?(_,x); !x})> l)
			   ; < my-assert (!"$template-parameters") > ("$value", l)
45
                           ; < definition > Declaration => Declaration'
david_v's avatar
david_v committed
46
47
48

strategies

49
  template-definition-stop(s) = template-definition-candidate
david_v's avatar
david_v committed
50
51
52

  template-definition = (template-definition-candidate;
                         TemplateDefinition)