PageRenderTime 108ms CodeModel.GetById 103ms app.highlight 3ms RepoModel.GetById 1ms app.codeStats 0ms

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

http://testability-explorer.googlecode.com/
Java | 64 lines | 34 code | 11 blank | 19 comment | 0 complexity | 318aa66b960ab832409886e8a37b1328 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.Visibility;
19import com.google.test.metric.cpp.dom.FunctionDeclaration;
20import com.google.test.metric.cpp.dom.Node;
21
22import java.util.List;
23
24/*
25 * Ignoring function declarations for now because they don't contribute to
26 * testability score.
27 */
28class FunctionDeclarationBuilder extends DefaultBuilder {
29
30  private final Node parent;
31  private final Visibility visibility;
32
33  public FunctionDeclarationBuilder(Node parent) {
34    this.parent = parent;
35    this.visibility = Visibility.PUBLIC;
36  }
37
38  public FunctionDeclarationBuilder(Node parent, Visibility visibility) {
39    this.parent = parent;
40    this.visibility = visibility;
41  }
42
43  @Override
44  public void directDeclarator(String id) {
45    parent.addChild(new FunctionDeclaration(id, visibility));
46  }
47
48  @Override
49  public void simpleTypeSpecifier(List<String> sts) {
50  }
51
52  @Override
53  public void endFunctionDeclaration() {
54    finished();
55  }
56
57  @Override
58  public void beginInitDeclaratorList() {
59  }
60
61  @Override
62  public void endInitDeclaratorList() {
63  }
64}