ctf: Move plugins to their own sub-directory
[deliverable/tracecompass.git] / ctf / org.eclipse.tracecompass.ctf.core / src / org / eclipse / tracecompass / ctf / core / event / scope / ILexicalScope.java
1 /*******************************************************************************
2 * Copyright (c) 2015 Ericsson
3 *
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
8 *
9 * Contributors: Matthew Khouzam - Initial API and implementation
10 *******************************************************************************/
11 package org.eclipse.tracecompass.ctf.core.event.scope;
12
13 import org.eclipse.jdt.annotation.NonNullByDefault;
14 import org.eclipse.jdt.annotation.Nullable;
15
16 /**
17 * @since 1.0
18 */
19 @NonNullByDefault
20 public interface ILexicalScope {
21 /**
22 * Empty string
23 */
24 ILexicalScope ROOT = new RootScope();
25
26 /**
27 * Trace string
28 */
29 ILexicalScope TRACE = new LexicalScope(ROOT, "trace"); //$NON-NLS-1$
30 /**
31 * Env string
32 */
33 ILexicalScope ENV = new LexicalScope(ROOT, "env"); //$NON-NLS-1$
34 /**
35 * Stream string
36 */
37 LexicalScope STREAM = new LexicalScope(ROOT, "stream"); //$NON-NLS-1$
38 /**
39 * Event string
40 */
41 LexicalScope EVENT = new LexicalScope(ROOT, "event"); //$NON-NLS-1$
42 /**
43 * Variant string
44 */
45 ILexicalScope VARIANT = new LexicalScope(ROOT, "variant"); //$NON-NLS-1$
46 /**
47 * packet string
48 */
49 LexicalScope PACKET = new LexicalScope(ROOT, "packet"); //$NON-NLS-1$
50 /**
51 * Packet header string
52 */
53 LexicalScope PACKET_HEADER = new PacketHeaderScope();
54
55 /**
56 * Packet header v id string
57 */
58 ILexicalScope EVENT_HEADER_V_ID = new LexicalScope(PACKET_HEADER, "id"); //$NON-NLS-1$
59 /**
60 * Packet header v timestamp string
61 */
62 ILexicalScope EVENT_HEADER_V_TIMESTAMP = new LexicalScope(PACKET_HEADER, "timestamp"); //$NON-NLS-1$
63
64 /**
65 * Stream packet scope
66 */
67 LexicalScope STREAM_PACKET = new LexicalScope(STREAM, "packet"); //$NON-NLS-1$
68 /**
69 * Stream Packet header string
70 */
71 ILexicalScope STREAM_PACKET_CONTEXT = new LexicalScope(STREAM_PACKET, "context"); //$NON-NLS-1$
72 /**
73 * Trace packet scope
74 */
75 LexicalScope TRACE_PACKET = new LexicalScope(TRACE, "packet"); //$NON-NLS-1$
76 /**
77 * Stream event scope
78 */
79 LexicalScope STREAM_EVENT = new LexicalScope(STREAM, "event"); //$NON-NLS-1$
80 /**
81 * Trace packet header string
82 */
83 ILexicalScope TRACE_PACKET_HEADER = new LexicalScope(TRACE_PACKET, "header"); //$NON-NLS-1$
84 /**
85 * Stream event context
86 */
87 ILexicalScope STREAM_EVENT_CONTEXT = new LexicalScope(STREAM_EVENT, "context"); //$NON-NLS-1$
88 /**
89 * Stream event header
90 */
91 ILexicalScope STREAM_EVENT_HEADER = new LexicalScope(STREAM_EVENT, "header"); //$NON-NLS-1$
92 /**
93 * Context of an event
94 */
95 LexicalScope CONTEXT = new LexicalScope(ROOT, "context"); //$NON-NLS-1$
96 /**
97 * Event Header scope
98 */
99 ILexicalScope EVENT_HEADER = new EventHeaderScope(EVENT, "header"); //$NON-NLS-1$
100
101 /**
102 * Event header id string
103 */
104 ILexicalScope EVENT_HEADER_ID = new LexicalScope(EVENT_HEADER, "id"); //$NON-NLS-1$
105
106 /**
107 * Event header v as in variant string
108 */
109 ILexicalScope EVENT_HEADER_V = new EventHeaderVScope(EVENT_HEADER, "v"); //$NON-NLS-1$
110
111 /**
112 * Fields in an event
113 */
114 ILexicalScope FIELDS = new FieldsScope(ROOT, "fields"); //$NON-NLS-1$
115
116 /**
117 * ret field
118 */
119 ILexicalScope FIELDS_RET = new LexicalScope(FIELDS, "_ret"); //$NON-NLS-1$
120
121 /**
122 * tid field
123 */
124 ILexicalScope FIELDS_TID = new LexicalScope(FIELDS, "_tid"); //$NON-NLS-1$
125
126 /**
127 * Get the name
128 *
129 * @return the name
130 */
131 String getName();
132
133 /**
134 * Gets a child of a given name
135 *
136 * @param name
137 * the child
138 * @return the scope, can be null
139 */
140 @Nullable
141 ILexicalScope getChild(String name);
142
143 // -------------------------------------------------------------------------
144 // helpers
145 // -------------------------------------------------------------------------
146
147 /**
148 * Adds a child lexical scope
149 *
150 * @param name
151 * the name of the child
152 * @param child
153 * the child
154 */
155 void addChild(String name, ILexicalScope child);
156
157 /**
158 * Get the path of the scope
159 *
160 * @return the path of the scope
161 */
162 String getPath();
163
164
165 }
This page took 0.035252 seconds and 5 git commands to generate.