"undefined" L C I(identifier, Identifier("undefined"), tk::Identifier_, hi::Operator);
-"false" L C I(false, False(), tk::False, hi::Constant);
-"null" L C I(null, Null(), tk::Null, hi::Constant);
-"true" L C I(true, True(), tk::True, hi::Constant);
-
-"auto" L C I(word, Word("auto"), tk::Auto, hi::Meta);
-"break" L R I(word, Word("break"), tk::Break, hi::Control);
-"case" L C I(word, Word("case"), tk::Case, hi::Control);
-"catch" L C I(word, Word("catch"), tk::Catch, hi::Control);
-"continue" L R I(word, Word("continue"), tk::Continue, hi::Control);
-"default" L C I(word, Word("default"), tk::Default, hi::Control);
-"delete" L C I(word, Word("delete"), tk::Delete, hi::Operator);
-"do" L C I(word, Word("do"), tk::Do, hi::Control);
-"else" L C I(word, Word("else"), tk::Else, hi::Control);
-"finally" L C I(word, Word("finally"), tk::Finally, hi::Control);
-"for" L C I(word, Word("for"), tk::For, hi::Control);
-"function" L C I(word, Word("function"), yyextra->no_.Function ? tk::Function_ : tk::Function, hi::Meta);
-"if" L C I(word, Word("if"), tk::If, hi::Control);
-"in" L C I(word, Word("in"), yyextra->in_.top() ? tk::In_ : tk::In, hi::Operator);
-"instanceof" L C I(word, Word("instanceof"), tk::InstanceOf, hi::Operator);
-"new" L C I(word, Word("new"), tk::New, hi::Operator);
-"return" L R I(word, Word("return"), tk::Return, hi::Control);
-"switch" L C I(word, Word("switch"), tk::Switch, hi::Control);
-"this" L C I(this, This(), tk::This, hi::Constant);
-"throw" L R I(word, Word("throw"), tk::Throw, hi::Control);
-"try" L C I(word, Word("try"), tk::Try, hi::Control);
-"typeof" L C I(word, Word("typeof"), tk::TypeOf, hi::Operator);
-"var" L C I(word, Word("var"), tk::Var, hi::Meta);
-"void" L C I(word, Word("void"), tk::Void, hi::Operator);
-"while" L C I(word, Word("while"), tk::While, hi::Control);
-"with" L C I(word, Word("with"), tk::With, hi::Control);
-
-"debugger" L C I(word, Word("debugger"), tk::Debugger, hi::Meta);
-
-"const" L C I(word, Word("const"), tk::Const, hi::Meta);
-
-"class" L C I(word, Word("class"), tk::Class, hi::Meta);
-"enum" L C I(word, Word("enum"), tk::Enum, hi::Meta);
-"export" L C I(word, Word("export"), tk::Export, hi::Meta);
-"extends" L C I(word, Word("extends"), tk::Extends, hi::Meta);
-"import" L C I(word, Word("import"), tk::Import, hi::Meta);
-"super" L C I(word, Word("super"), tk::Super, hi::Constant);
+"false" L C F(tk::False, hi::Constant);
+"null" L C F(tk::Null, hi::Constant);
+"true" L C F(tk::True, hi::Constant);
+
+"auto" L C F(tk::Auto, hi::Meta);
+"break" L R F(tk::Break, hi::Control);
+"case" L C F(tk::Case, hi::Control);
+"catch" L C F(tk::Catch, hi::Control);
+"continue" L R F(tk::Continue, hi::Control);
+"default" L C F(tk::Default, hi::Control);
+"delete" L C F(tk::Delete, hi::Operator);
+"do" L C F(tk::Do, hi::Control);
+"else" L C F(tk::Else, hi::Control);
+"finally" L C F(tk::Finally, hi::Control);
+"for" L C F(tk::For, hi::Control);
+"function" L C F(yyextra->no_.Function ? tk::Function_ : tk::Function, hi::Meta);
+"if" L C F(tk::If, hi::Control);
+"in" L C F(yyextra->in_.top() ? tk::In_ : tk::In, hi::Operator);
+"instanceof" L C F(tk::InstanceOf, hi::Operator);
+"new" L C F(tk::New, hi::Operator);
+"return" L R F(tk::Return, hi::Control);
+"switch" L C F(tk::Switch, hi::Control);
+"this" L C F(tk::This, hi::Constant);
+"throw" L R F(tk::Throw, hi::Control);
+"try" L C F(tk::Try, hi::Control);
+"typeof" L C F(tk::TypeOf, hi::Operator);
+"var" L C F(tk::Var, hi::Meta);
+"void" L C F(tk::Void, hi::Operator);
+"while" L C F(tk::While, hi::Control);
+"with" L C F(tk::With, hi::Control);
+
+"debugger" L C F(tk::Debugger, hi::Meta);
+
+"const" L C F(tk::Const, hi::Meta);
+
+"class" L C F(tk::Class, hi::Meta);
+"enum" L C F(tk::Enum, hi::Meta);
+"export" L C F(tk::Export, hi::Meta);
+"extends" L C F(tk::Extends, hi::Meta);
+"import" L C F(tk::Import, hi::Meta);
+"super" L C F(tk::Super, hi::Constant);
"implements" L C I(identifier, Identifier("implements"), tk::Implements, hi::Meta);
"interface" L C I(identifier, Identifier("interface"), tk::Interface, hi::Meta);
%token <identifier_> No "NO"
@end
-%token <false_> False "false"
-%token <null_> Null "null"
-%token <true_> True "true"
+%token False "false"
+%token Null "null"
+%token True "true"
// ES3/ES5/WIE/JSC Reserved
-%token <word_> Auto "auto"
-%token <word_> Break "break"
-%token <word_> Case "case"
-%token <word_> Catch "catch"
-%token <word_> Continue "continue"
-%token <word_> Default "default"
-%token <word_> Delete "delete"
-%token <word_> Do "do"
-%token <word_> Else "else"
-%token <word_> Finally "finally"
-%token <word_> For "for"
-%token <word_> Function "function"
-%token <word_> Function_ ";function"
-%token <word_> If "if"
-%token <word_> In "in"
-%token <word_> In_ "!in"
-%token <word_> InstanceOf "instanceof"
-%token <word_> New "new"
-%token <word_> Return "return"
-%token <word_> Switch "switch"
-%token <this_> This "this"
-%token <word_> Throw "throw"
-%token <word_> Try "try"
-%token <word_> TypeOf "typeof"
-%token <word_> Var "var"
-%token <word_> Void "void"
-%token <word_> While "while"
-%token <word_> With "with"
+%token Auto "auto"
+%token Break "break"
+%token Case "case"
+%token Catch "catch"
+%token Continue "continue"
+%token Default "default"
+%token Delete "delete"
+%token Do "do"
+%token Else "else"
+%token Finally "finally"
+%token For "for"
+%token Function "function"
+%token Function_ ";function"
+%token If "if"
+%token In "in"
+%token In_ "!in"
+%token InstanceOf "instanceof"
+%token New "new"
+%token Return "return"
+%token Switch "switch"
+%token This "this"
+%token Throw "throw"
+%token Try "try"
+%token TypeOf "typeof"
+%token Var "var"
+%token Void "void"
+%token While "while"
+%token With "with"
// ES3/IE6 Future, ES5/JSC Reserved
-%token <word_> Debugger "debugger"
+%token Debugger "debugger"
// ES3/ES5/IE6 Future, JSC Reserved
-%token <word_> Const "const"
+%token Const "const"
// ES3/ES5/IE6/JSC Future
-%token <word_> Class "class"
-%token <word_> Enum "enum"
-%token <word_> Export "export"
-%token <word_> Extends "extends"
-%token <word_> Import "import"
-%token <word_> Super "super"
+%token Class "class"
+%token Enum "enum"
+%token Export "export"
+%token Extends "extends"
+%token Import "import"
+%token Super "super"
// ES3 Future, ES5 Strict Future
%token <identifier_> Implements "implements"
Word
: Identifier { $$ = $1; }
- | "auto" { $$ = $1; }
- | "break" NewLineOpt { $$ = $1; }
- | "case" { $$ = $1; }
- | "catch" { $$ = $1; }
- | "class" { $$ = $1; }
- | "const" { $$ = $1; }
- | "continue" NewLineOpt { $$ = $1; }
- | "debugger" { $$ = $1; }
- | "default" { $$ = $1; }
- | "delete" LexSetRegExp { $$ = $1; }
- | "do" { $$ = $1; }
- | "else" { $$ = $1; }
- | "enum" { $$ = $1; }
- | "export" { $$ = $1; }
- | "extends" { $$ = $1; }
- | "false" { $$ = $1; }
- | "finally" { $$ = $1; }
- /* XXX: | "for" { $$ = $1; } */
- | "function" { $$ = $1; }
- | "if" { $$ = $1; }
- | "import" { $$ = $1; }
- /* XXX: | "in" { $$ = $1; } */
- | "!in" { $$ = $1; }
- /* XXX: | "instanceof" { $$ = $1; } */
+ | "auto" { $$ = CYNew CYWord("auto"); }
+ | "break" NewLineOpt { $$ = CYNew CYWord("break"); }
+ | "case" { $$ = CYNew CYWord("case"); }
+ | "catch" { $$ = CYNew CYWord("catch"); }
+ | "class" { $$ = CYNew CYWord("class"); }
+ | "const" { $$ = CYNew CYWord("const"); }
+ | "continue" NewLineOpt { $$ = CYNew CYWord("continue"); }
+ | "debugger" { $$ = CYNew CYWord("debugger"); }
+ | "default" { $$ = CYNew CYWord("default"); }
+ | "delete" LexSetRegExp { $$ = CYNew CYWord("delete"); }
+ | "do" { $$ = CYNew CYWord("do"); }
+ | "else" { $$ = CYNew CYWord("else"); }
+ | "enum" { $$ = CYNew CYWord("enum"); }
+ | "export" { $$ = CYNew CYWord("export"); }
+ | "extends" { $$ = CYNew CYWord("extends"); }
+ | "false" { $$ = CYNew CYWord("false"); }
+ | "finally" { $$ = CYNew CYWord("finally"); }
+ /* XXX: | "for" { $$ = CYNew CYWord("for"); } */
+ | "function" { $$ = CYNew CYWord("function"); }
+ | "if" { $$ = CYNew CYWord("if"); }
+ | "import" { $$ = CYNew CYWord("import"); }
+ /* XXX: | "in" { $$ = CYNew CYWord("in"); } */
+ | "!in" { $$ = CYNew CYWord("in"); }
+ /* XXX: | "instanceof" { $$ = CYNew CYWord("instanceof"); } */
// XXX: as it currently is not an Identifier
| "let" { $$ = $1; }
- | "new" LexSetRegExp { $$ = $1; }
- | "null" { $$ = $1; }
- | "return" NewLineOpt { $$ = $1; }
- | "super" { $$ = $1; }
- | "switch" { $$ = $1; }
- | "this" { $$ = $1; }
- | "throw" NewLineOpt { $$ = $1; }
- | "true" { $$ = $1; }
- | "try" { $$ = $1; }
- | "typeof" LexSetRegExp { $$ = $1; }
- | "var" { $$ = $1; }
- | "void" LexSetRegExp { $$ = $1; }
- | "while" { $$ = $1; }
- | "with" { $$ = $1; }
+ | "new" LexSetRegExp { $$ = CYNew CYWord("new"); }
+ | "null" { $$ = CYNew CYWord("null"); }
+ | "return" NewLineOpt { $$ = CYNew CYWord("return"); }
+ | "super" { $$ = CYNew CYWord("super"); }
+ | "switch" { $$ = CYNew CYWord("switch"); }
+ | "this" { $$ = CYNew CYWord("this"); }
+ | "throw" NewLineOpt { $$ = CYNew CYWord("throw"); }
+ | "true" { $$ = CYNew CYWord("true"); }
+ | "try" { $$ = CYNew CYWord("try"); }
+ | "typeof" LexSetRegExp { $$ = CYNew CYWord("typeof"); }
+ | "var" { $$ = CYNew CYWord("var"); }
+ | "void" LexSetRegExp { $$ = CYNew CYWord("void"); }
+ | "while" { $$ = CYNew CYWord("while"); }
+ | "with" { $$ = CYNew CYWord("with"); }
;
@begin ObjectiveC
/* }}} */
/* 7.8.1 Null Literals {{{ */
NullLiteral
- : "null" { $$ = $1; }
+ : "null" { $$ = CYNew CYNull(); }
;
/* }}} */
/* 7.8.2 Boolean Literals {{{ */
BooleanLiteral
- : "true" { $$ = $1; }
- | "false" { $$ = $1; }
+ : "true" { $$ = CYNew CYTrue(); }
+ | "false" { $$ = CYNew CYFalse(); }
;
/* }}} */
;
PrimaryExpression
- : "this" { $$ = $1; }
+ : "this" { $$ = CYNew CYThis(); }
| Variable { $$ = $1; }
| Literal { $$ = $1; }
| ArrayInitialiser { $$ = $1; }