crashanalysercmd/PerfToolsSharedLibraries/Engine/SymBuildParsingLib/Parser/PreProcessor/Workers/SymPreProcessorWorkerIfs.cs
changeset 0 818e61de6cd1
equal deleted inserted replaced
-1:000000000000 0:818e61de6cd1
       
     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 SymBuildParsingLib.Tree;
       
    20 using SymBuildParsingLib.Parser.Framework;
       
    21 using SymBuildParsingLib.Parser.Framework.Workers;
       
    22 using SymBuildParsingLib.Parser.PreProcessor.Nodes;
       
    23 
       
    24 namespace SymBuildParsingLib.Parser.PreProcessor.Workers
       
    25 {
       
    26 	public class SymPreProcessorWorkerIf : SymPreProcessorWorkerConditionalExpression
       
    27 	{
       
    28 		#region Constructors & destructor
       
    29 		public SymPreProcessorWorkerIf( SymParserWorkerContext aContext )
       
    30 			: base( aContext )
       
    31 		{
       
    32 			// The base class will make a new conditional expression node at the current document position.
       
    33 			// It will change the parent node to be this new node. We must make a new condition worker
       
    34 			// that will handle reading the condition arguments. 
       
    35 			SymParserWorkerContext context = new SymParserWorkerContext( WorkerContext.Document.Context, this );
       
    36 			SymParserWorkerCondition conditionWorker = new SymParserWorkerCondition( context, new SymNodePreProcessorCondition( aContext.CurrentToken.Value ) );
       
    37 			AddChild( conditionWorker );
       
    38 		}
       
    39 		#endregion
       
    40 	}
       
    41 
       
    42 	public class SymPreProcessorWorkerIfdef : SymPreProcessorWorkerConditionalExpression
       
    43 	{
       
    44 		#region Constructors & destructor
       
    45 		public SymPreProcessorWorkerIfdef( SymParserWorkerContext aContext )
       
    46 			: base( aContext )
       
    47 		{
       
    48 			// The base class will make a new conditional expression node at the current document position.
       
    49 			// It will change the parent node to be this new node. We must make a new condition worker
       
    50 			// that will handle reading the condition arguments. 
       
    51 			SymParserWorkerContext context = new SymParserWorkerContext( WorkerContext.Document.Context, this );
       
    52 			SymParserWorkerCondition conditionWorker = new SymParserWorkerCondition( context, new SymNodePreProcessorCondition( aContext.CurrentToken.Value ) );
       
    53 			AddChild( conditionWorker );
       
    54 		}
       
    55 		#endregion
       
    56 	}
       
    57 
       
    58 
       
    59 	public class SymPreProcessorWorkerIfndef : SymPreProcessorWorkerConditionalExpression
       
    60 	{
       
    61 		#region Constructors & destructor
       
    62 		public SymPreProcessorWorkerIfndef( SymParserWorkerContext aContext )
       
    63 			: base( aContext )
       
    64 		{
       
    65 			// The base class will make a new conditional expression node at the current document position.
       
    66 			// It will change the parent node to be this new node. We must make a new condition worker
       
    67 			// that will handle reading the condition arguments. 
       
    68 			SymParserWorkerContext context = new SymParserWorkerContext( WorkerContext.Document.Context, this );
       
    69 			SymParserWorkerCondition conditionWorker = new SymParserWorkerCondition( context, new SymNodePreProcessorCondition( aContext.CurrentToken.Value ) );
       
    70 			AddChild( conditionWorker );
       
    71 		}
       
    72 		#endregion
       
    73 	}
       
    74 }