PageRenderTime 9ms CodeModel.GetById 1ms app.highlight 5ms RepoModel.GetById 1ms app.codeStats 0ms

/cpp/src/main/java/com/google/test/metric/cpp/GlobalScopeBuilder.java

http://testability-explorer.googlecode.com/
Java | 68 lines | 40 code | 13 blank | 15 comment | 0 complexity | b03d9811f2c7314c7c428436262d42a1 MD5 | raw file
 1/*
 2 * Copyright 2008 Google Inc.
 3 *
 4 * Licensed under the Apache License, Version 2.0 (the "License"); you may not
 5 * use this file except in compliance with the License. You may obtain a copy of
 6 * the License at
 7 *
 8 * http://www.apache.org/licenses/LICENSE-2.0
 9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13 * License for the specific language governing permissions and limitations under
14 * the License.
15 */
16package com.google.test.metric.cpp;
17
18import com.google.test.metric.cpp.dom.Node;
19
20import java.util.List;
21
22class GlobalScopeBuilder extends DefaultBuilder {
23
24  private final Node parent;
25  private List<String> sts;
26
27  GlobalScopeBuilder(Node parent) {
28    this.parent = parent;
29  }
30
31  @Override
32  public void beginClassDefinition(String type, String identifier) {
33    pushBuilder(new ClassBuilder(parent, identifier));
34  }
35
36  @Override
37  public void enterNamespaceScope(String ns) {
38    pushBuilder(new NamespaceBuilder(parent, ns));
39  }
40
41  @Override
42  public void beginFunctionDefinition(int line) {
43    pushBuilder(new FunctionDefinitionBuilder(parent, line));
44  }
45
46  @Override
47  public void beginFunctionDeclaration() {
48    pushBuilder(new FunctionDeclarationBuilder(parent));
49  }
50
51  @Override
52  public void simpleTypeSpecifier(List<String> sts) {
53    this.sts = sts;
54  }
55
56  @Override
57  public void beginInitDeclaratorList() {
58    pushBuilder(new VariableDeclarationBuilder(parent, sts));
59  }
60
61  @Override
62  public void beginBaseSpecifier() {
63  }
64
65  @Override
66  public void endBaseSpecifier() {
67  }
68}