vrq
/usr/src/RPM/BUILD/vrq-1.0.96/src/systask.h
Go to the documentation of this file.
00001 /*****************************************************************************
00002  * Copyright (C) 1997-2007, Mark Hummel
00003  * This file is part of Vrq.
00004  *
00005  * Vrq is free software; you can redistribute it and/or
00006  * modify it under the terms of the GNU General Public
00007  * License as published by the Free Software Foundation; either
00008  * version 2 of the License, or (at your option) any later version.
00009  *
00010  * Vrq is distributed in the hope that it will be useful,
00011  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00012  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013  * General Public License for more details.
00014  *
00015  * You should have received a copy of the GNU General Public
00016  * License along with this library; if not, write to the Free Software
00017  * Foundation, Inc., 51 Franklin Street, Fifth Floor, 
00018  * Boston, MA  02110-1301  USA
00019  *****************************************************************************
00020  */
00021 /******************************************************************************
00022  *
00023  *
00024  *         systask.hpp
00025  *              - manager for systask info 
00026  *
00027  ******************************************************************************
00028  */
00029 
00030 #ifndef SYSTASK_HPP
00031 #define SYSTASK_HPP
00032 
00036 class Systask {
00037 public:
00041         static void Initialize() {}
00048         static int Width( CSymbol* symbol, CNode* args ) 
00049         { 
00050             /*
00051              * implement builtin functions
00052              */
00053             if( !strcmp(symbol->GetName(), "$signed" ) ) {
00054                 return args->GetWidth();
00055             }
00056             return 32; 
00057         }
00064         static CNode* WidthExp( CSymbol* symbol, CNode* args ) 
00065         { 
00066             /*
00067              * implement builtin functions
00068              */
00069             if( !strcmp(symbol->GetName(), "$signed" ) ) {
00070                 return args->GetWidthExp();
00071             }
00072             return cINT32(32); 
00073         }
00082         static int WidthConstant( CSymbol* symbol, CNode* args ) 
00083         { 
00084             /*
00085              * implement builtin functions
00086              */
00087             if( !strcmp(symbol->GetName(), "$signed" ) ) {
00088                 return args->IsWidthConstant();
00089             }
00090             return FALSE; 
00091         }
00100         static int WidthVolatile( CSymbol* symbol, CNode* args ) 
00101         { 
00102             /*
00103              * implement builtin functions
00104              */
00105             if( !strcmp(symbol->GetName(), "$signed" ) ) {
00106                 return args->IsWidthVolatile();
00107             }
00108             return TRUE; 
00109         }
00117         static int WidthEvaluateable( CSymbol* symbol, CNode* args ) 
00118         { 
00119             /*
00120              * implement builtin functions
00121              */
00122             if( !strcmp(symbol->GetName(), "$signed" ) ) {
00123                 return args->IsWidthEvaluateable();
00124             }
00125             return FALSE; 
00126         }
00134         static NodeType_t Type( CSymbol* symbol, CNode* args ) 
00135         { 
00136             /*
00137              * implement builtin functions
00138              */
00139             if( !strcmp(symbol->GetName(), "$signed" ) ) {
00140                 return eS;
00141             }
00142             return eB; 
00143         }
00144 };
00145 
00146 #endif // SYSTASK_HPP