|
1 /* |
|
2 * Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: |
|
15 * |
|
16 * Interface to location parser |
|
17 * |
|
18 */ |
|
19 package com.nokia.tracecompiler.project; |
|
20 |
|
21 import com.nokia.tracecompiler.engine.TraceLocation; |
|
22 import com.nokia.tracecompiler.engine.TraceCompilerEngineErrorCodes.TraceCompilerErrorCode; |
|
23 import com.nokia.tracecompiler.engine.source.SourceParserRule.TraceConversionResult; |
|
24 import com.nokia.tracecompiler.model.TraceCompilerException; |
|
25 import com.nokia.tracecompiler.source.SourceExcludedArea; |
|
26 |
|
27 /** |
|
28 * Interface to location parser. The parser is implemented into the project API |
|
29 * |
|
30 */ |
|
31 public interface TraceLocationParser { |
|
32 |
|
33 /** |
|
34 * Processes a newly parsed location. The location has not yet been |
|
35 * associated with a trace. |
|
36 * |
|
37 * @param location |
|
38 * the new location |
|
39 */ |
|
40 public void processNewLocation(TraceLocation location); |
|
41 |
|
42 /** |
|
43 * Gets the group where locations created by this parser belong |
|
44 * |
|
45 * @return the location group |
|
46 */ |
|
47 public String getLocationGroup(); |
|
48 |
|
49 /** |
|
50 * Converts a location to trace |
|
51 * |
|
52 * @param location |
|
53 * the location to be parsed |
|
54 * @return properties for new trace |
|
55 * @throws TraceCompilerException |
|
56 * if the location cannot be converted |
|
57 */ |
|
58 public TraceConversionResult convertLocation(TraceLocation location) |
|
59 throws TraceCompilerException; |
|
60 |
|
61 /** |
|
62 * Finds the comment related to given location |
|
63 * |
|
64 * @param location |
|
65 * the location to be checked |
|
66 * @return the comment related to the location or null if not found |
|
67 */ |
|
68 public SourceExcludedArea findLocationComment(TraceLocation location); |
|
69 |
|
70 /** |
|
71 * Determines if a location parsed from source should be automatically |
|
72 * converted to a trace. This is called only if |
|
73 * isLocationAutoConvertSupported has returned true |
|
74 * |
|
75 * @param location |
|
76 * the location to be checked |
|
77 * |
|
78 * @return true if automatically converted, false if not |
|
79 */ |
|
80 public boolean isLocationConverted(TraceLocation location); |
|
81 |
|
82 /** |
|
83 * Checks if a location matches its trace |
|
84 * |
|
85 * @param location |
|
86 * the location to be checked |
|
87 * @return error code from TraceCompilerErrorCodes |
|
88 */ |
|
89 public TraceCompilerErrorCode checkLocationValidity(TraceLocation location); |
|
90 |
|
91 } |