1 /*******************************************************************************
2 * Copyright (c) 2015 Ericsson
4 * All rights reserved. This program and the accompanying materials are made
5 * available under the terms of the Eclipse Public License v1.0 which
6 * accompanies this distribution, and is available at
7 * http://www.eclipse.org/legal/epl-v10.html
9 * Contributors: Matthew Khouzam - Initial API and implementation
10 *******************************************************************************/
11 package org
.eclipse
.tracecompass
.ctf
.core
.event
.scope
;
13 import org
.eclipse
.jdt
.annotation
.NonNullByDefault
;
14 import org
.eclipse
.jdt
.annotation
.Nullable
;
20 public interface ILexicalScope
{
24 ILexicalScope ROOT
= new RootScope();
29 ILexicalScope TRACE
= new LexicalScope(ROOT
, "trace"); //$NON-NLS-1$
33 ILexicalScope ENV
= new LexicalScope(ROOT
, "env"); //$NON-NLS-1$
37 LexicalScope STREAM
= new LexicalScope(ROOT
, "stream"); //$NON-NLS-1$
41 LexicalScope EVENT
= new LexicalScope(ROOT
, "event"); //$NON-NLS-1$
45 ILexicalScope VARIANT
= new LexicalScope(ROOT
, "variant"); //$NON-NLS-1$
49 LexicalScope PACKET
= new LexicalScope(ROOT
, "packet"); //$NON-NLS-1$
51 * Packet header string
53 LexicalScope PACKET_HEADER
= new PacketHeaderScope();
56 * Packet header v id string
58 ILexicalScope EVENT_HEADER_V_ID
= new LexicalScope(PACKET_HEADER
, "id"); //$NON-NLS-1$
60 * Packet header v timestamp string
62 ILexicalScope EVENT_HEADER_V_TIMESTAMP
= new LexicalScope(PACKET_HEADER
, "timestamp"); //$NON-NLS-1$
67 LexicalScope STREAM_PACKET
= new LexicalScope(STREAM
, "packet"); //$NON-NLS-1$
69 * Stream Packet header string
71 ILexicalScope STREAM_PACKET_CONTEXT
= new LexicalScope(STREAM_PACKET
, "context"); //$NON-NLS-1$
75 LexicalScope TRACE_PACKET
= new LexicalScope(TRACE
, "packet"); //$NON-NLS-1$
79 LexicalScope STREAM_EVENT
= new LexicalScope(STREAM
, "event"); //$NON-NLS-1$
81 * Trace packet header string
83 ILexicalScope TRACE_PACKET_HEADER
= new LexicalScope(TRACE_PACKET
, "header"); //$NON-NLS-1$
85 * Stream event context
87 ILexicalScope STREAM_EVENT_CONTEXT
= new LexicalScope(STREAM_EVENT
, "context"); //$NON-NLS-1$
91 ILexicalScope STREAM_EVENT_HEADER
= new LexicalScope(STREAM_EVENT
, "header"); //$NON-NLS-1$
95 LexicalScope CONTEXT
= new LexicalScope(ROOT
, "context"); //$NON-NLS-1$
99 ILexicalScope EVENT_HEADER
= new EventHeaderScope(EVENT
, "header"); //$NON-NLS-1$
102 * Event header id string
104 ILexicalScope EVENT_HEADER_ID
= new LexicalScope(EVENT_HEADER
, "id"); //$NON-NLS-1$
107 * Event header v as in variant string
109 ILexicalScope EVENT_HEADER_V
= new EventHeaderVScope(EVENT_HEADER
, "v"); //$NON-NLS-1$
114 ILexicalScope FIELDS
= new FieldsScope(ROOT
, "fields"); //$NON-NLS-1$
119 ILexicalScope FIELDS_RET
= new LexicalScope(FIELDS
, "_ret"); //$NON-NLS-1$
124 ILexicalScope FIELDS_TID
= new LexicalScope(FIELDS
, "_tid"); //$NON-NLS-1$
134 * Gets a child of a given name
138 * @return the scope, can be null
141 ILexicalScope
getChild(String name
);
143 // -------------------------------------------------------------------------
145 // -------------------------------------------------------------------------
148 * Adds a child lexical scope
151 * the name of the child
155 void addChild(String name
, ILexicalScope child
);
158 * Get the path of the scope
160 * @return the path of the scope