1 /****************************************************************************
3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
4 ** All rights reserved.
5 ** Contact: Nokia Corporation (qt-info@nokia.com)
7 ** This file is part of the utils of the Qt Toolkit.
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
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.
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.
28 ** If you have questions regarding the use of this file, please contact
29 ** Nokia at qt-info@nokia.com.
40 ****************************************************************************/
76 NON_TERMINAL_COUNT
= 24,
78 GOTO_INDEX_OFFSET
= 69,
79 GOTO_INFO_OFFSET
= 76,
80 GOTO_CHECK_OFFSET
= 76
83 static const char *const spell
[];
84 static const int lhs
[];
85 static const int rhs
[];
86 static const int goto_default
[];
87 static const int action_default
[];
88 static const int action_index
[];
89 static const int action_info
[];
90 static const int action_check
[];
92 inline int nt_action (int state
, int nt
) const
94 const int *const goto_index
= &action_index
[GOTO_INDEX_OFFSET
];
95 const int *const goto_check
= &action_check
[GOTO_CHECK_OFFSET
];
97 const int yyn
= goto_index
[state
] + nt
;
99 if (yyn
< 0 || goto_check
[yyn
] != nt
)
100 return goto_default
[nt
];
102 const int *const goto_info
= &action_info
[GOTO_INFO_OFFSET
];
103 return goto_info
[yyn
];
106 inline int t_action (int state
, int token
) const
108 const int yyn
= action_index
[state
] + token
;
110 if (yyn
< 0 || action_check
[yyn
] != token
)
111 return - action_default
[state
];
113 return action_info
[yyn
];
118 #endif // GRAMMAR_P_H