87d3fea326078a3d68db2529aef35fb54ffbbc60
[deliverable/tracecompass.git] / ctf / org.eclipse.tracecompass.ctf.core / src / org / eclipse / tracecompass / internal / ctf / core / event / metadata / tsdl / integer / ClockMapParser.java
1 /*******************************************************************************
2 * Copyright (c) 2015 Ericsson
3 *
4 * All rights reserved. This program and the accompanying materials
5 * are made available under the terms of the Eclipse Public License v1.0
6 * which accompanies this distribution, and is available at
7 * http://www.eclipse.org/legal/epl-v10.html
8 *******************************************************************************/
9
10 package org.eclipse.tracecompass.internal.ctf.core.event.metadata.tsdl.integer;
11
12 import org.antlr.runtime.tree.CommonTree;
13 import org.eclipse.jdt.annotation.NonNull;
14 import org.eclipse.tracecompass.internal.ctf.core.event.metadata.ICommonTreeParser;
15
16 /**
17 * A reference to the clock map in a given integer.
18 *
19 * @author Matthew Khouzam
20 *
21 */
22 public class ClockMapParser implements ICommonTreeParser {
23
24 private static final @NonNull String EMPTY_STRING = ""; //$NON-NLS-1$
25
26 /**
27 * Instance
28 */
29 public static final ClockMapParser INSTANCE = new ClockMapParser();
30
31 private ClockMapParser() {
32 }
33
34 @Override
35 public String parse(CommonTree tree, ICommonTreeParserParameter param) {
36 String clock = tree.getChild(1).getChild(0).getChild(0).getText();
37 return clock == null ? EMPTY_STRING : clock;
38 }
39
40 }
This page took 0.033931 seconds and 4 git commands to generate.