GME  13
OCLParserStatic.h
Go to the documentation of this file.
00001 //###############################################################################################################################################
00002 //
00003 //      Object Constraint Language Generic Manager
00004 //      OCLParserStatic.h
00005 //
00006 //###############################################################################################################################################
00007 
00008 #include "OCLCommon.h"
00009 
00010 #include "OCLTokens.h"
00011 #include <set>
00012 
00013 using namespace std;
00014 
00015 typedef std::set< int > TokenSet;
00016 
00017 extern TokenSet First_name;
00018 extern TokenSet First_typeName;
00019 extern TokenSet First_colon;
00020 extern TokenSet First_inputend;
00021 extern TokenSet First_expression;
00022 extern TokenSet First_contextDeclarationHelper;
00023 
00024 extern TokenSet First_inv;
00025 extern TokenSet First_right_parenthesis;
00026 extern TokenSet First_left_parenthesis;
00027 extern TokenSet First_formalParameterList;
00028 extern TokenSet First_prePost;
00029 extern TokenSet First_formalParameter;
00030 extern TokenSet First_letExpression;
00031 extern TokenSet First_implicationExpression;
00032 extern TokenSet First_in;
00033 extern TokenSet First_equal;
00034 extern TokenSet First_then;
00035 extern TokenSet First_else;
00036 extern TokenSet First_endif;
00037 extern TokenSet First_orExpression;
00038 extern TokenSet First_xorExpression;
00039 extern TokenSet First_andExpression;
00040 extern TokenSet First_relationalExpression;
00041 extern TokenSet First_additiveExpression;
00042 extern TokenSet First_multiplicativeExpression;
00043 extern TokenSet First_unaryExpression;
00044 extern TokenSet First_postfixExpression;
00045 extern TokenSet First_featureCall;
00046 extern TokenSet First_primaryExpression;
00047 extern TokenSet First_featureCallParametersHelper;
00048 extern TokenSet First_featureCallParameters;
00049 extern TokenSet First_delimiter;
00050 extern TokenSet First_actualParameterList;
00051 extern TokenSet First_right_bracket;
00052 extern TokenSet First_literal;
00053 extern TokenSet First_left_brace;
00054 extern TokenSet First_right_brace;
00055 extern TokenSet First_expressionListOrRange;
00056 extern TokenSet First_qualifiers;
00057 
00058 extern TokenSet Last_contextDeclarationHelper;
00059 extern TokenSet Last_literal;
00060 extern TokenSet Last_primaryExpression;
00061 extern TokenSet Last_featureCall;
00062 extern TokenSet Last_featureCallParametersHelper;
00063 extern TokenSet Last_expression;
00064 extern TokenSet Last_implicationExpression;
00065 
00066 #define CLASS_MULTIPLICATIVE            1000
00067 #define CLASS_ADDITIVE                          1001
00068 #define CLASS_RELATIONAL                        1002
00069 #define CLASS_LOGICAL                           1003
00070 #define CLASS_PREPOST                           1004
00071 #define CLASS_STEREOTYPES                       1005
00072 #define CLASS_UNARY                             1006
00073 #define CLASS_BOOLEAN                           1007
00074 #define CLASS_CALLKIND                          1008
00075 #define CLASS_LOGICAL_AND                       1009
00076 #define CLASS_LOGICAL_OR                        1010
00077 #define CLASS_LOGICAL_IMPLIES   1011
00078 
00079 #define LID_NODE_START                                  0
00080 #define LID_CALL_OPERATOR                               1
00081 #define LID_DECLARATOR_NAME                     2
00082 #define LID_DECLARATOR_NAME2            3
00083 #define LID_DECLARATOR_TYPE                     4
00084 #define LID_ACCUMULATOR_NAME            5
00085 #define LID_ACCUMULATOR_TYPE            6
00086 #define LID_FEATURE_NAME                                7
00087 #define LID_CONSTRAINT_NAME                     8
00088 #define LID_CONTEXT_TYPE                                9
00089 #define LID_CONTEXT_STEREOTYPE          10
00090 #define LID_CONTEXT_RETURNTYPE          11
00091 #define LID_VARIABLE_NAME                       12
00092 #define LID_VARIABLE_TYPE                               13
00093 #define LID_ROLE_NAME                                   14
00094 #define LID_PARAMETER_NAME                      100
00095 #define LID_PARAMETER_TYPE                      200
00096 
00097 void            InitializeTokenSets();
00098 TokenSet        Union( const TokenSet& setTokens1, const TokenSet& setTokens2 );
00099 TokenSet        Union( const TokenSet& setTokens, int iToken );
00100 std::string             PrintToken( int iToken, bool bQuote );
00101 std::string             PrintTokens( const TokenSet& setTokens );
00102 bool            Contains( const TokenSet& setTokens1, const TokenSet& setTokens2 );
00103 bool            Contains( const TokenSet& setTokens, int iToken );
00104