/cpp/src/main/java/com/google/test/metric/cpp/AssignmentExpressionBuilder.java
Java | 58 lines | 33 code | 10 blank | 15 comment | 0 complexity | 34dd2c971101f222624f44ac50e2711a MD5 | raw file
Possible License(s): Apache-2.0
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.Name; 19import com.google.test.metric.cpp.dom.Node; 20import com.google.test.metric.cpp.dom.NodeList; 21 22public class AssignmentExpressionBuilder extends ExpressionBuilder { 23 24 private final NodeList nodes; 25 26 public AssignmentExpressionBuilder(Node parent) { 27 super(parent); 28 this.nodes = parent.getExpressions(); 29 } 30 31 public AssignmentExpressionBuilder(NodeList nodes) { 32 super(nodes); 33 this.nodes = nodes; 34 } 35 36 @Override 37 public void idExpression(String id) { 38 nodes.add(new Name(id)); 39 } 40 41 @Override 42 public void beginAssignmentExpression(int line) { 43 pushBuilder(new AssignmentExpressionBuilder(nodes)); 44 } 45 46 @Override 47 public void endAssignmentExpression() { 48 finished(); 49 } 50 51 @Override 52 public void beginPostfixExpression() { 53 } 54 55 @Override 56 public void endPostfixExpression() { 57 } 58}