Initial import of the CDE 2.1.30 sources from the Open Group.
[oweals/cde.git] / cde / programs / dtinfo / dtinfogen / infolib / etc / ConcatTask.C
1 /* $XConsortium: ConcatTask.C /main/3 1996/08/21 15:46:12 drk $ */
2 /* exported interfaces */
3 #include "ConcatTask.h"
4
5 /* imported interfaces */
6 #include "Expression.h"
7 #include "ExprList.h"
8 #include "Token.h"
9 #include "AttributeData.h"
10 #include "Content.h"
11 #include "FirstOf.h"
12 #include "GenericId.h"
13 #include "Literal.h"
14
15 Concat::Concat( const Token &t, 
16                 ExprList *elist,
17                 ActionType mode):OL_Data(t, mode)
18 {
19   
20   for ( OL_Expression *eptr = elist->first();
21         eptr;
22         eptr = elist->next(eptr) ) {
23     switch ( eptr->type() ) {
24
25       case REFERENCE:
26         addSubTask( new AttributeData( t, eptr->name(), mode ));
27         break;
28         
29       case CONTENT:
30         addSubTask( new Content(t,mode) );
31         break;
32
33       case CONCAT:
34         addSubTask( new Concat( t, 
35                                 (ExprList *)eptr->data_list(),
36                                 mode) );
37         break;
38
39       case FIRSTOF:
40         addSubTask( new FirstOf( t,
41                                  (ExprList *)eptr->data_list(),
42                                  mode) );
43         break;
44
45       case GENERIC_ID:
46         addSubTask( new GenericId( t,
47                                    eptr->name(),
48                                    mode) );
49         break;
50
51       case LITERAL:
52         addSubTask( new Literal( t, 
53                                  ( const char *)eptr->data_list(),
54                                  mode) );
55         break;
56     
57       default:
58         abort();
59     }
60   }
61 }
62
63