|
1 /* |
|
2 * Copyright (c) 2004-2008 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 */ |
|
17 |
|
18 using System; |
|
19 using SymbianTree; |
|
20 using SymBuildParsingLib.Tree; |
|
21 using SymBuildParsingLib.Common.Objects; |
|
22 using SymBuildParsingLib.Parser.Framework.Parser; |
|
23 |
|
24 namespace SymBuildParsingLib.Parser.Framework.Document |
|
25 { |
|
26 public class SymParserDocumentContext |
|
27 { |
|
28 #region Constructors & destructor |
|
29 public SymParserDocumentContext( string aFileName ) |
|
30 { |
|
31 iFileName = aFileName; |
|
32 |
|
33 // Construct empty directories |
|
34 iDefineDirectory = new SymDefineDirectory(); |
|
35 iIncludeDirectory = new SymIncludeDirectory(); |
|
36 } |
|
37 |
|
38 public SymParserDocumentContext( string aFileName, SymDefineDirectory aDefineDirectory, SymIncludeDirectory aIncludeDirectory ) |
|
39 { |
|
40 iFileName = aFileName; |
|
41 // |
|
42 iDefineDirectory = aDefineDirectory; |
|
43 iIncludeDirectory = aIncludeDirectory; |
|
44 } |
|
45 |
|
46 public SymParserDocumentContext( SymParserDocumentContext aContext ) |
|
47 { |
|
48 iFileName = aContext.FileName; |
|
49 // |
|
50 iDefineDirectory = aContext.DefineDirectory; |
|
51 iIncludeDirectory = aContext.IncludeDirectory; |
|
52 // |
|
53 iDocument = aContext.Document; |
|
54 iParser = aContext.Parser; |
|
55 } |
|
56 |
|
57 public SymParserDocumentContext( string aFileName, SymParserDocumentContext aContext ) |
|
58 { |
|
59 iFileName = aFileName; |
|
60 // |
|
61 iDefineDirectory = aContext.DefineDirectory; |
|
62 iIncludeDirectory = aContext.IncludeDirectory; |
|
63 // |
|
64 iDocument = aContext.Document; |
|
65 iParser = aContext.Parser; |
|
66 } |
|
67 #endregion |
|
68 |
|
69 #region Properties |
|
70 public SymNode CurrentNode |
|
71 { |
|
72 get { return iDocument.CurrentNode; } |
|
73 set { iDocument.CurrentNode = value; } |
|
74 } |
|
75 |
|
76 public SymDefineDirectory DefineDirectory |
|
77 { |
|
78 get { return iDefineDirectory; } |
|
79 } |
|
80 |
|
81 public SymIncludeDirectory IncludeDirectory |
|
82 { |
|
83 get { return iIncludeDirectory; } |
|
84 } |
|
85 |
|
86 public string FileName |
|
87 { |
|
88 get { return iFileName; } |
|
89 } |
|
90 |
|
91 public SymParserDocument Document |
|
92 { |
|
93 get { return iDocument; } |
|
94 set { iDocument = value; } |
|
95 } |
|
96 |
|
97 public SymParserBase Parser |
|
98 { |
|
99 get { return iParser; } |
|
100 set { iParser = value; } |
|
101 } |
|
102 #endregion |
|
103 |
|
104 #region Data members |
|
105 private readonly string iFileName; |
|
106 private SymParserDocument iDocument; |
|
107 private readonly SymDefineDirectory iDefineDirectory; |
|
108 private readonly SymIncludeDirectory iIncludeDirectory; |
|
109 private SymParserBase iParser; |
|
110 #endregion |
|
111 } |
|
112 } |