Qt 4.8
Public Types | Static Public Functions | Static Public Variables | List of all members
QScriptGrammar Class Reference

#include <qscriptgrammar_p.h>

Inheritance diagram for QScriptGrammar:
QScript::SyntaxChecker QScriptParser

Public Types

enum  {
  EOF_SYMBOL = 0, T_AND = 1, T_AND_AND = 2, T_AND_EQ = 3,
  T_AUTOMATIC_SEMICOLON = 62, T_BREAK = 4, T_CASE = 5, T_CATCH = 6,
  T_COLON = 7, T_COMMA = 8, T_CONST = 81, T_CONTINUE = 9,
  T_DEBUGGER = 82, T_DEFAULT = 10, T_DELETE = 11, T_DIVIDE_ = 12,
  T_DIVIDE_EQ = 13, T_DO = 14, T_DOT = 15, T_ELSE = 16,
  T_EQ = 17, T_EQ_EQ = 18, T_EQ_EQ_EQ = 19, T_FALSE = 80,
  T_FINALLY = 20, T_FOR = 21, T_FUNCTION = 22, T_GE = 23,
  T_GT = 24, T_GT_GT = 25, T_GT_GT_EQ = 26, T_GT_GT_GT = 27,
  T_GT_GT_GT_EQ = 28, T_IDENTIFIER = 29, T_IF = 30, T_IN = 31,
  T_INSTANCEOF = 32, T_LBRACE = 33, T_LBRACKET = 34, T_LE = 35,
  T_LPAREN = 36, T_LT = 37, T_LT_LT = 38, T_LT_LT_EQ = 39,
  T_MINUS = 40, T_MINUS_EQ = 41, T_MINUS_MINUS = 42, T_NEW = 43,
  T_NOT = 44, T_NOT_EQ = 45, T_NOT_EQ_EQ = 46, T_NULL = 78,
  T_NUMERIC_LITERAL = 47, T_OR = 48, T_OR_EQ = 49, T_OR_OR = 50,
  T_PLUS = 51, T_PLUS_EQ = 52, T_PLUS_PLUS = 53, T_QUESTION = 54,
  T_RBRACE = 55, T_RBRACKET = 56, T_REMAINDER = 57, T_REMAINDER_EQ = 58,
  T_RESERVED_WORD = 83, T_RETURN = 59, T_RPAREN = 60, T_SEMICOLON = 61,
  T_STAR = 63, T_STAR_EQ = 64, T_STRING_LITERAL = 65, T_SWITCH = 66,
  T_THIS = 67, T_THROW = 68, T_TILDE = 69, T_TRUE = 79,
  T_TRY = 70, T_TYPEOF = 71, T_VAR = 72, T_VOID = 73,
  T_WHILE = 74, T_WITH = 75, T_XOR = 76, T_XOR_EQ = 77,
  ACCEPT_STATE = 237, RULE_COUNT = 269, STATE_COUNT = 468, TERMINAL_COUNT = 84,
  NON_TERMINAL_COUNT = 88, GOTO_INDEX_OFFSET = 468, GOTO_INFO_OFFSET = 1562, GOTO_CHECK_OFFSET = 1562
}
 

Static Public Functions

static int nt_action (int state, int nt)
 
static int t_action (int state, int token)
 

Static Public Variables

static const short action_check []
 
static const short action_default []
 
static const short action_index []
 
static const short action_info []
 
static const short goto_default []
 
static const short lhs []
 
static const short rhs []
 
static const int rule_index []
 
static const int rule_info []
 
static const char *const spell []
 

Detailed Description

Definition at line 43 of file qscriptgrammar_p.h.

Enumerations

◆ anonymous enum

anonymous enum
Enumerator
EOF_SYMBOL 
T_AND 
T_AND_AND 
T_AND_EQ 
T_AUTOMATIC_SEMICOLON 
T_BREAK 
T_CASE 
T_CATCH 
T_COLON 
T_COMMA 
T_CONST 
T_CONTINUE 
T_DEBUGGER 
T_DEFAULT 
T_DELETE 
T_DIVIDE_ 
T_DIVIDE_EQ 
T_DO 
T_DOT 
T_ELSE 
T_EQ 
T_EQ_EQ 
T_EQ_EQ_EQ 
T_FALSE 
T_FINALLY 
T_FOR 
T_FUNCTION 
T_GE 
T_GT 
T_GT_GT 
T_GT_GT_EQ 
T_GT_GT_GT 
T_GT_GT_GT_EQ 
T_IDENTIFIER 
T_IF 
T_IN 
T_INSTANCEOF 
T_LBRACE 
T_LBRACKET 
T_LE 
T_LPAREN 
T_LT 
T_LT_LT 
T_LT_LT_EQ 
T_MINUS 
T_MINUS_EQ 
T_MINUS_MINUS 
T_NEW 
T_NOT 
T_NOT_EQ 
T_NOT_EQ_EQ 
T_NULL 
T_NUMERIC_LITERAL 
T_OR 
T_OR_EQ 
T_OR_OR 
T_PLUS 
T_PLUS_EQ 
T_PLUS_PLUS 
T_QUESTION 
T_RBRACE 
T_RBRACKET 
T_REMAINDER 
T_REMAINDER_EQ 
T_RESERVED_WORD 
T_RETURN 
T_RPAREN 
T_SEMICOLON 
T_STAR 
T_STAR_EQ 
T_STRING_LITERAL 
T_SWITCH 
T_THIS 
T_THROW 
T_TILDE 
T_TRUE 
T_TRY 
T_TYPEOF 
T_VAR 
T_VOID 
T_WHILE 
T_WITH 
T_XOR 
T_XOR_EQ 
ACCEPT_STATE 
RULE_COUNT 
STATE_COUNT 
TERMINAL_COUNT 
NON_TERMINAL_COUNT 
GOTO_INDEX_OFFSET 
GOTO_INFO_OFFSET 
GOTO_CHECK_OFFSET 

Definition at line 46 of file qscriptgrammar_p.h.

46  {
47  EOF_SYMBOL = 0,
48  T_AND = 1,
49  T_AND_AND = 2,
50  T_AND_EQ = 3,
52  T_BREAK = 4,
53  T_CASE = 5,
54  T_CATCH = 6,
55  T_COLON = 7,
56  T_COMMA = 8,
57  T_CONST = 81,
58  T_CONTINUE = 9,
59  T_DEBUGGER = 82,
60  T_DEFAULT = 10,
61  T_DELETE = 11,
62  T_DIVIDE_ = 12,
63  T_DIVIDE_EQ = 13,
64  T_DO = 14,
65  T_DOT = 15,
66  T_ELSE = 16,
67  T_EQ = 17,
68  T_EQ_EQ = 18,
69  T_EQ_EQ_EQ = 19,
70  T_FALSE = 80,
71  T_FINALLY = 20,
72  T_FOR = 21,
73  T_FUNCTION = 22,
74  T_GE = 23,
75  T_GT = 24,
76  T_GT_GT = 25,
77  T_GT_GT_EQ = 26,
78  T_GT_GT_GT = 27,
79  T_GT_GT_GT_EQ = 28,
80  T_IDENTIFIER = 29,
81  T_IF = 30,
82  T_IN = 31,
83  T_INSTANCEOF = 32,
84  T_LBRACE = 33,
85  T_LBRACKET = 34,
86  T_LE = 35,
87  T_LPAREN = 36,
88  T_LT = 37,
89  T_LT_LT = 38,
90  T_LT_LT_EQ = 39,
91  T_MINUS = 40,
92  T_MINUS_EQ = 41,
93  T_MINUS_MINUS = 42,
94  T_NEW = 43,
95  T_NOT = 44,
96  T_NOT_EQ = 45,
97  T_NOT_EQ_EQ = 46,
98  T_NULL = 78,
99  T_NUMERIC_LITERAL = 47,
100  T_OR = 48,
101  T_OR_EQ = 49,
102  T_OR_OR = 50,
103  T_PLUS = 51,
104  T_PLUS_EQ = 52,
105  T_PLUS_PLUS = 53,
106  T_QUESTION = 54,
107  T_RBRACE = 55,
108  T_RBRACKET = 56,
109  T_REMAINDER = 57,
110  T_REMAINDER_EQ = 58,
111  T_RESERVED_WORD = 83,
112  T_RETURN = 59,
113  T_RPAREN = 60,
114  T_SEMICOLON = 61,
115  T_STAR = 63,
116  T_STAR_EQ = 64,
117  T_STRING_LITERAL = 65,
118  T_SWITCH = 66,
119  T_THIS = 67,
120  T_THROW = 68,
121  T_TILDE = 69,
122  T_TRUE = 79,
123  T_TRY = 70,
124  T_TYPEOF = 71,
125  T_VAR = 72,
126  T_VOID = 73,
127  T_WHILE = 74,
128  T_WITH = 75,
129  T_XOR = 76,
130  T_XOR_EQ = 77,
131 
132  ACCEPT_STATE = 237,
133  RULE_COUNT = 269,
134  STATE_COUNT = 468,
135  TERMINAL_COUNT = 84,
136  NON_TERMINAL_COUNT = 88,
137 
138  GOTO_INDEX_OFFSET = 468,
139  GOTO_INFO_OFFSET = 1562,
140  GOTO_CHECK_OFFSET = 1562
141  };

Functions

◆ nt_action()

static int QScriptGrammar::nt_action ( int  state,
int  nt 
)
inlinestatic

Definition at line 158 of file qscriptgrammar_p.h.

Referenced by QScript::SyntaxChecker::checkSyntax(), and QScriptParser::parse().

159  {
160  const int yyn = action_index [GOTO_INDEX_OFFSET + state] + nt;
161  if (yyn < 0 || action_check [GOTO_CHECK_OFFSET + yyn] != nt)
162  return goto_default [nt];
163 
164  return action_info [GOTO_INFO_OFFSET + yyn];
165  }
static const short action_check[]
static const short goto_default[]
#define nt(var, enu)
static const short action_info[]
static const short action_index[]

◆ t_action()

static int QScriptGrammar::t_action ( int  state,
int  token 
)
inlinestatic

Definition at line 167 of file qscriptgrammar_p.h.

Referenced by QScript::SyntaxChecker::checkSyntax(), and QScriptParser::parse().

168  {
169  const int yyn = action_index [state] + token;
170 
171  if (yyn < 0 || action_check [yyn] != token)
172  return - action_default [state];
173 
174  return action_info [yyn];
175  }
static const short action_check[]
static const short action_info[]
static const short action_index[]
static const short action_default[]

Properties

◆ action_check

const short QScriptGrammar::action_check
static

Definition at line 156 of file qscriptgrammar_p.h.

◆ action_default

const short QScriptGrammar::action_default
static

Definition at line 153 of file qscriptgrammar_p.h.

◆ action_index

const short QScriptGrammar::action_index
static

◆ action_info

const short QScriptGrammar::action_info
static

Definition at line 155 of file qscriptgrammar_p.h.

◆ goto_default

const short QScriptGrammar::goto_default
static
Initial value:
= {
29, 28, 439, 437, 113, 112, 14, 2, 438, 111,
114, 194, 24, 17, 190, 26, 8, 201, 21, 27,
77, 25, 1, 32, 30, 270, 13, 264, 3, 260,
5, 262, 4, 261, 22, 268, 23, 269, 9, 263,
259, 300, 389, 265, 266, 35, 6, 79, 12, 15,
18, 19, 10, 7, 31, 80, 20, 36, 75, 76,
11, 357, 356, 78, 459, 458, 322, 323, 461, 325,
460, 324, 395, 399, 402, 398, 397, 417, 418, 16,
100, 107, 96, 99, 106, 108, 33, 0}

Definition at line 152 of file qscriptgrammar_p.h.

◆ lhs

const short QScriptGrammar::lhs
static
Initial value:
= {
85, 85, 85, 85, 85, 85, 85, 85, 85, 85,
85, 85, 85, 85, 85, 87, 87, 92, 92, 86,
86, 89, 89, 93, 93, 93, 93, 94, 94, 94,
94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
94, 94, 94, 94, 94, 94, 94, 94, 95, 95,
96, 96, 96, 96, 96, 99, 99, 100, 100, 100,
100, 98, 98, 101, 101, 102, 102, 103, 103, 103,
104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
105, 105, 105, 105, 106, 106, 106, 107, 107, 107,
107, 108, 108, 108, 108, 108, 108, 108, 109, 109,
109, 109, 109, 109, 110, 110, 110, 110, 110, 111,
111, 111, 111, 111, 112, 112, 113, 113, 114, 114,
115, 115, 116, 116, 117, 117, 118, 118, 119, 119,
120, 120, 121, 121, 122, 122, 123, 123, 91, 91,
124, 124, 125, 125, 125, 125, 125, 125, 125, 125,
125, 125, 125, 125, 90, 90, 126, 126, 127, 127,
128, 128, 129, 129, 129, 129, 129, 129, 129, 129,
129, 129, 129, 129, 129, 129, 129, 130, 146, 146,
145, 145, 131, 131, 147, 147, 148, 148, 150, 150,
149, 151, 154, 152, 152, 155, 153, 153, 132, 133,
133, 134, 134, 135, 135, 135, 135, 135, 135, 135,
136, 136, 136, 136, 137, 137, 137, 137, 138, 138,
139, 141, 156, 156, 159, 159, 157, 157, 160, 158,
140, 142, 142, 143, 143, 143, 161, 162, 144, 144,
163, 97, 167, 167, 164, 164, 165, 165, 168, 84,
169, 169, 170, 170, 166, 166, 88, 88, 171}

Definition at line 144 of file qscriptgrammar_p.h.

Referenced by QScript::SyntaxChecker::checkSyntax(), and QScriptParser::parse().

◆ rhs

const short QScriptGrammar::rhs
static
Initial value:
= {
1, 1, 1, 1, 1, 1, 1, 1, 1, 3,
3, 5, 3, 4, 3, 2, 4, 1, 2, 0,
1, 3, 5, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 4, 3, 3, 1, 2, 2, 2, 4,
3, 2, 3, 1, 3, 1, 1, 1, 2, 2,
1, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1, 3, 3, 3, 1, 3, 3, 1, 3, 3,
3, 1, 3, 3, 3, 3, 3, 3, 1, 3,
3, 3, 3, 3, 1, 3, 3, 3, 3, 1,
3, 3, 3, 3, 1, 3, 1, 3, 1, 3,
1, 3, 1, 3, 1, 3, 1, 3, 1, 3,
1, 3, 1, 3, 1, 5, 1, 5, 1, 3,
1, 3, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 3, 0, 1, 1, 3,
0, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 3, 1, 2,
0, 1, 3, 3, 1, 1, 1, 3, 1, 3,
2, 2, 2, 0, 1, 2, 0, 1, 1, 2,
2, 7, 5, 7, 7, 5, 9, 10, 7, 8,
2, 2, 3, 3, 2, 2, 3, 3, 3, 3,
5, 5, 3, 5, 1, 2, 0, 1, 4, 3,
3, 3, 3, 3, 3, 4, 5, 2, 2, 2,
8, 8, 1, 3, 0, 1, 0, 1, 1, 1,
1, 2, 1, 1, 0, 1, 0, 1, 2}

Definition at line 145 of file qscriptgrammar_p.h.

Referenced by QScript::SyntaxChecker::checkSyntax(), and QScriptParser::parse().

◆ rule_index

const int QScriptGrammar::rule_index
static
Initial value:
= {
0, 2, 4, 6, 8, 10, 12, 14, 16, 18,
22, 26, 32, 36, 41, 45, 48, 53, 55, 58,
59, 61, 65, 71, 73, 75, 77, 79, 81, 83,
85, 87, 89, 91, 93, 95, 97, 99, 101, 103,
105, 107, 109, 111, 113, 115, 117, 119, 121, 123,
125, 127, 129, 131, 133, 135, 137, 139, 141, 143,
145, 147, 149, 154, 158, 162, 164, 167, 170, 173,
178, 182, 185, 189, 191, 195, 197, 199, 201, 204,
207, 209, 212, 215, 218, 221, 224, 227, 230, 233,
236, 238, 242, 246, 250, 252, 256, 260, 262, 266,
270, 274, 276, 280, 284, 288, 292, 296, 300, 302,
306, 310, 314, 318, 322, 324, 328, 332, 336, 340,
342, 346, 350, 354, 358, 360, 364, 366, 370, 372,
376, 378, 382, 384, 388, 390, 394, 396, 400, 402,
406, 408, 412, 414, 418, 420, 426, 428, 434, 436,
440, 442, 446, 448, 450, 452, 454, 456, 458, 460,
462, 464, 466, 468, 470, 472, 476, 477, 479, 481,
485, 486, 488, 490, 492, 494, 496, 498, 500, 502,
504, 506, 508, 510, 512, 514, 516, 518, 522, 524,
527, 528, 530, 534, 538, 540, 542, 544, 548, 550,
554, 557, 560, 563, 564, 566, 569, 570, 572, 574,
577, 580, 588, 594, 602, 610, 616, 626, 637, 645,
654, 657, 660, 664, 668, 671, 674, 678, 682, 686,
690, 696, 702, 706, 712, 714, 717, 718, 720, 725,
729, 733, 737, 741, 745, 749, 754, 760, 763, 766,
769, 778, 787, 789, 793, 794, 796, 797, 799, 801,
803, 805, 808, 810, 812, 813, 815, 816, 818}

Definition at line 148 of file qscriptgrammar_p.h.

◆ rule_info

const int QScriptGrammar::rule_info
static

Definition at line 149 of file qscriptgrammar_p.h.

◆ spell

const char *const QScriptGrammar::spell
static
Initial value:
= {
"end of file", "&", "&&", "&=", "break", "case", "catch", ":", ";", "continue",
"default", "delete", "/", "/=", "do", ".", "else", "=", "==", "===",
"finally", "for", "function", ">=", ">", ">>", ">>=", ">>>", ">>>=", "identifier",
"if", "in", "instanceof", "{", "[", "<=", "(", "<", "<<", "<<=",
"-", "-=", "--", "new", "!", "!=", "!==", "numeric literal", "|", "|=",
"||", "+", "+=", "++", "?", "}", "]", "%", "%=", "return",
")", ";", 0, "*", "*=", "string literal", "switch", "this", "throw", "~",
"try", "typeof", "var", "void", "while", "with", "^", "^=", "null", "true",
"false", "const", "debugger", "reserved word",
"Program", "PrimaryExpression", "ElisionOpt", "ElementList", "PropertyNameAndValueListOpt", "PropertyNameAndValueList",
"Expression", "AssignmentExpression", "Elision", "PropertyName", "ReservedIdentifier", "PropertyIdentifier", "MemberExpression", "FunctionExpression", "Arguments", "NewExpression",
"CallExpression", "ArgumentList", "LeftHandSideExpression", "PostfixExpression", "UnaryExpression", "MultiplicativeExpression", "AdditiveExpression", "ShiftExpression", "RelationalExpression", "RelationalExpressionNotIn",
"EqualityExpression", "EqualityExpressionNotIn", "BitwiseANDExpression", "BitwiseANDExpressionNotIn", "BitwiseXORExpression", "BitwiseXORExpressionNotIn", "BitwiseORExpression", "BitwiseORExpressionNotIn", "LogicalANDExpression", "LogicalANDExpressionNotIn",
"LogicalORExpression", "LogicalORExpressionNotIn", "ConditionalExpression", "ConditionalExpressionNotIn", "AssignmentExpressionNotIn", "AssignmentOperator", "ExpressionOpt", "ExpressionNotIn", "ExpressionNotInOpt", "Statement",
"Block", "VariableStatement", "EmptyStatement", "ExpressionStatement", "IfStatement", "IterationStatement", "ContinueStatement", "BreakStatement", "ReturnStatement", "WithStatement",
"LabelledStatement", "SwitchStatement", "ThrowStatement", "TryStatement", "DebuggerStatement", "StatementListOpt", "StatementList", "VariableDeclarationKind", "VariableDeclarationList", "VariableDeclaration",
"VariableDeclarationListNotIn", "VariableDeclarationNotIn", "InitialiserOpt", "InitialiserNotInOpt", "Initialiser", "InitialiserNotIn", "CaseBlock", "CaseClausesOpt", "DefaultClause", "CaseClauses",
"CaseClause", "Catch", "Finally", "FunctionDeclaration", "FormalParameterListOpt", "FunctionBodyOpt", "IdentifierOpt", "FormalParameterList", "FunctionBody", "SourceElements",
"SourceElement", "$accept"
}

Definition at line 143 of file qscriptgrammar_p.h.

Referenced by QScript::SyntaxChecker::checkSyntax(), and QScriptParser::parse().


The documentation for this class was generated from the following files: