src/script/parser/qscriptgrammar_p.h
changeset 0 1918ee327afb
child 3 41300fa6a67c
equal deleted inserted replaced
-1:000000000000 0:1918ee327afb
       
     1 /****************************************************************************
       
     2 **
       
     3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
       
     4 ** All rights reserved.
       
     5 ** Contact: Nokia Corporation (qt-info@nokia.com)
       
     6 **
       
     7 ** This file is part of the QtScript module of the Qt Toolkit.
       
     8 **
       
     9 ** $QT_BEGIN_LICENSE:LGPL$
       
    10 ** No Commercial Usage
       
    11 ** This file contains pre-release code and may not be distributed.
       
    12 ** You may use this file in accordance with the terms and conditions
       
    13 ** contained in the Technology Preview License Agreement accompanying
       
    14 ** this package.
       
    15 **
       
    16 ** GNU Lesser General Public License Usage
       
    17 ** Alternatively, this file may be used under the terms of the GNU Lesser
       
    18 ** General Public License version 2.1 as published by the Free Software
       
    19 ** Foundation and appearing in the file LICENSE.LGPL included in the
       
    20 ** packaging of this file.  Please review the following information to
       
    21 ** ensure the GNU Lesser General Public License version 2.1 requirements
       
    22 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
       
    23 **
       
    24 ** In addition, as a special exception, Nokia gives you certain additional
       
    25 ** rights.  These rights are described in the Nokia Qt LGPL Exception
       
    26 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
       
    27 **
       
    28 ** If you have questions regarding the use of this file, please contact
       
    29 ** Nokia at qt-info@nokia.com.
       
    30 **
       
    31 **
       
    32 **
       
    33 **
       
    34 **
       
    35 **
       
    36 **
       
    37 **
       
    38 ** $QT_END_LICENSE$
       
    39 **
       
    40 ****************************************************************************/
       
    41 
       
    42 // This file was generated by qlalr - DO NOT EDIT!
       
    43 
       
    44 #ifndef QSCRIPTGRAMMAR_P_H
       
    45 #define QSCRIPTGRAMMAR_P_H
       
    46 
       
    47 //
       
    48 //  W A R N I N G
       
    49 //  -------------
       
    50 //
       
    51 // This file is not part of the Qt API.  It exists for the convenience
       
    52 // of other Qt classes.  This header file may change from version to
       
    53 // version without notice, or even be removed.
       
    54 //
       
    55 // We mean it.
       
    56 //
       
    57 
       
    58 #include <QtCore/qglobal.h>
       
    59 
       
    60 QT_BEGIN_NAMESPACE
       
    61 
       
    62 class QScriptGrammar
       
    63 {
       
    64 public:
       
    65   enum {
       
    66     EOF_SYMBOL = 0,
       
    67     T_AND = 1,
       
    68     T_AND_AND = 2,
       
    69     T_AND_EQ = 3,
       
    70     T_AUTOMATIC_SEMICOLON = 62,
       
    71     T_BREAK = 4,
       
    72     T_CASE = 5,
       
    73     T_CATCH = 6,
       
    74     T_COLON = 7,
       
    75     T_COMMA = 8,
       
    76     T_CONST = 81,
       
    77     T_CONTINUE = 9,
       
    78     T_DEBUGGER = 82,
       
    79     T_DEFAULT = 10,
       
    80     T_DELETE = 11,
       
    81     T_DIVIDE_ = 12,
       
    82     T_DIVIDE_EQ = 13,
       
    83     T_DO = 14,
       
    84     T_DOT = 15,
       
    85     T_ELSE = 16,
       
    86     T_EQ = 17,
       
    87     T_EQ_EQ = 18,
       
    88     T_EQ_EQ_EQ = 19,
       
    89     T_FALSE = 80,
       
    90     T_FINALLY = 20,
       
    91     T_FOR = 21,
       
    92     T_FUNCTION = 22,
       
    93     T_GE = 23,
       
    94     T_GT = 24,
       
    95     T_GT_GT = 25,
       
    96     T_GT_GT_EQ = 26,
       
    97     T_GT_GT_GT = 27,
       
    98     T_GT_GT_GT_EQ = 28,
       
    99     T_IDENTIFIER = 29,
       
   100     T_IF = 30,
       
   101     T_IN = 31,
       
   102     T_INSTANCEOF = 32,
       
   103     T_LBRACE = 33,
       
   104     T_LBRACKET = 34,
       
   105     T_LE = 35,
       
   106     T_LPAREN = 36,
       
   107     T_LT = 37,
       
   108     T_LT_LT = 38,
       
   109     T_LT_LT_EQ = 39,
       
   110     T_MINUS = 40,
       
   111     T_MINUS_EQ = 41,
       
   112     T_MINUS_MINUS = 42,
       
   113     T_NEW = 43,
       
   114     T_NOT = 44,
       
   115     T_NOT_EQ = 45,
       
   116     T_NOT_EQ_EQ = 46,
       
   117     T_NULL = 78,
       
   118     T_NUMERIC_LITERAL = 47,
       
   119     T_OR = 48,
       
   120     T_OR_EQ = 49,
       
   121     T_OR_OR = 50,
       
   122     T_PLUS = 51,
       
   123     T_PLUS_EQ = 52,
       
   124     T_PLUS_PLUS = 53,
       
   125     T_QUESTION = 54,
       
   126     T_RBRACE = 55,
       
   127     T_RBRACKET = 56,
       
   128     T_REMAINDER = 57,
       
   129     T_REMAINDER_EQ = 58,
       
   130     T_RESERVED_WORD = 83,
       
   131     T_RETURN = 59,
       
   132     T_RPAREN = 60,
       
   133     T_SEMICOLON = 61,
       
   134     T_STAR = 63,
       
   135     T_STAR_EQ = 64,
       
   136     T_STRING_LITERAL = 65,
       
   137     T_SWITCH = 66,
       
   138     T_THIS = 67,
       
   139     T_THROW = 68,
       
   140     T_TILDE = 69,
       
   141     T_TRUE = 79,
       
   142     T_TRY = 70,
       
   143     T_TYPEOF = 71,
       
   144     T_VAR = 72,
       
   145     T_VOID = 73,
       
   146     T_WHILE = 74,
       
   147     T_WITH = 75,
       
   148     T_XOR = 76,
       
   149     T_XOR_EQ = 77,
       
   150 
       
   151     ACCEPT_STATE = 237,
       
   152     RULE_COUNT = 269,
       
   153     STATE_COUNT = 468,
       
   154     TERMINAL_COUNT = 84,
       
   155     NON_TERMINAL_COUNT = 88,
       
   156 
       
   157     GOTO_INDEX_OFFSET = 468,
       
   158     GOTO_INFO_OFFSET = 1562,
       
   159     GOTO_CHECK_OFFSET = 1562
       
   160   };
       
   161 
       
   162   static const char  *const spell [];
       
   163   static const int            lhs [];
       
   164   static const int            rhs [];
       
   165 
       
   166 #ifndef QLALR_NO_QSCRIPTGRAMMAR_DEBUG_INFO
       
   167   static const int     rule_index [];
       
   168   static const int      rule_info [];
       
   169 #endif // QLALR_NO_QSCRIPTGRAMMAR_DEBUG_INFO
       
   170 
       
   171   static const int   goto_default [];
       
   172   static const int action_default [];
       
   173   static const int   action_index [];
       
   174   static const int    action_info [];
       
   175   static const int   action_check [];
       
   176 
       
   177   static inline int nt_action (int state, int nt)
       
   178   {
       
   179     const int *const goto_index = &action_index [GOTO_INDEX_OFFSET];
       
   180     const int *const goto_check = &action_check [GOTO_CHECK_OFFSET];
       
   181 
       
   182     const int yyn = goto_index [state] + nt;
       
   183 
       
   184     if (yyn < 0 || goto_check [yyn] != nt)
       
   185       return goto_default [nt];
       
   186 
       
   187     const int *const goto_info = &action_info [GOTO_INFO_OFFSET];
       
   188     return goto_info [yyn];
       
   189   }
       
   190 
       
   191   static inline int t_action (int state, int token)
       
   192   {
       
   193     const int yyn = action_index [state] + token;
       
   194 
       
   195     if (yyn < 0 || action_check [yyn] != token)
       
   196       return - action_default [state];
       
   197 
       
   198     return action_info [yyn];
       
   199   }
       
   200 };
       
   201 
       
   202 QT_END_NAMESPACE
       
   203 
       
   204 #endif // QSCRIPTGRAMMAR_P_H