OLD | NEW |
(Empty) | |
| 1 /* |
| 2 * Copyright (c) 2013, the Dart project authors. |
| 3 * |
| 4 * Licensed under the Eclipse Public License v1.0 (the "License"); you may not u
se this file except |
| 5 * in compliance with the License. You may obtain a copy of the License at |
| 6 * |
| 7 * http://www.eclipse.org/legal/epl-v10.html |
| 8 * |
| 9 * Unless required by applicable law or agreed to in writing, software distribut
ed under the License |
| 10 * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY K
IND, either express |
| 11 * or implied. See the License for the specific language governing permissions a
nd limitations under |
| 12 * the License. |
| 13 */ |
| 14 package com.google.dart.engine.html.ast; |
| 15 |
| 16 import com.google.dart.engine.ast.Expression; |
| 17 |
| 18 /** |
| 19 * Instances of the class {@code EmbeddedExpression} represent an expression enc
losed between |
| 20 * <code>{{</code> and <code>}}</code> delimiters. |
| 21 */ |
| 22 public class EmbeddedExpression { |
| 23 /** |
| 24 * The offset of the first character of the opening delimiter. |
| 25 */ |
| 26 private int openingOffset; |
| 27 |
| 28 /** |
| 29 * The expression that is enclosed between the delimiters. |
| 30 */ |
| 31 private Expression expression; |
| 32 |
| 33 /** |
| 34 * The offset of the first character of the closing delimiter. |
| 35 */ |
| 36 private int closingOffset; |
| 37 |
| 38 /** |
| 39 * An empty array of embedded expressions. |
| 40 */ |
| 41 public static final EmbeddedExpression[] EMPTY_ARRAY = new EmbeddedExpression[
0]; |
| 42 |
| 43 /** |
| 44 * Initialize a newly created embedded expression to represent the given expre
ssion. |
| 45 * |
| 46 * @param openingOffset the offset of the first character of the opening delim
iter |
| 47 * @param expression the expression that is enclosed between the delimiters |
| 48 * @param closingOffset the offset of the first character of the closing delim
iter |
| 49 */ |
| 50 public EmbeddedExpression(int openingOffset, Expression expression, int closin
gOffset) { |
| 51 this.openingOffset = openingOffset; |
| 52 this.expression = expression; |
| 53 this.closingOffset = closingOffset; |
| 54 } |
| 55 |
| 56 /** |
| 57 * Return the offset of the first character of the closing delimiter. |
| 58 * |
| 59 * @return the offset of the first character of the closing delimiter |
| 60 */ |
| 61 public int getClosingOffset() { |
| 62 return closingOffset; |
| 63 } |
| 64 |
| 65 /** |
| 66 * Return the expression that is enclosed between the delimiters. |
| 67 * |
| 68 * @return the expression that is enclosed between the delimiters |
| 69 */ |
| 70 public Expression getExpression() { |
| 71 return expression; |
| 72 } |
| 73 |
| 74 /** |
| 75 * Return the offset of the first character of the opening delimiter. |
| 76 * |
| 77 * @return the offset of the first character of the opening delimiter |
| 78 */ |
| 79 public int getOpeningOffset() { |
| 80 return openingOffset; |
| 81 } |
| 82 } |
OLD | NEW |