-%parse-param { CYParser *context }
-
-%token CYTokenAmpersand "&"
-%token CYTokenAmpersandAmpersand "&&"
-%token CYTokenAmpersandEqual "&="
-%token CYTokenCarrot "^"
-%token CYTokenCarrotEqual "^="
-%token CYTokenEqual "="
-%token CYTokenEqualEqual "=="
-%token CYTokenEqualEqualEqual "==="
-%token CYTokenExclamation "!"
-%token CYTokenExclamationEqual "!="
-%token CYTokenExclamationEqualEqual "!=="
-%token CYTokenHyphen "-"
-%token CYTokenHyphenEqual "-="
-%token CYTokenHyphenHyphen "--"
-%token CYTokenHyphenRight "->"
-%token CYTokenLeft "<"
-%token CYTokenLeftEqual "<="
-%token CYTokenLeftLeft "<<"
-%token CYTokenLeftLeftEqual "<<="
-%token CYTokenPercent "%"
-%token CYTokenPercentEqual "%="
-%token CYTokenPeriod "."
-%token CYTokenPipe "|"
-%token CYTokenPipeEqual "|="
-%token CYTokenPipePipe "||"
-%token CYTokenPlus "+"
-%token CYTokenPlusEqual "+="
-%token CYTokenPlusPlus "++"
-%token CYTokenRight ">"
-%token CYTokenRightEqual ">="
-%token CYTokenRightRight ">>"
-%token CYTokenRightRightEqual ">>="
-%token CYTokenRightRightRight ">>>"
-%token CYTokenRightRightRightEqual ">>>="
-%token CYTokenSlash "/"
-%token CYTokenSlashEqual "/="
-%token CYTokenStar "*"
-%token CYTokenStarEqual "*="
-%token CYTokenTilde "~"
-
-%token CYTokenColon ":"
-%token CYTokenComma ","
-%token CYTokenQuestion "?"
-%token CYTokenSemiColon ";"
-
-%token CYTokenOpenParen "("
-%token CYTokenCloseParen ")"
-%token CYTokenOpenBrace "{"
-%token CYTokenCloseBrace "}"
-%token CYTokenOpenBracket "["
-%token CYTokenCloseBracket "]"
-
-%token CYTokenBreak "break"
-%token CYTokenCase "case"
-%token CYTokenCatch "catch"
-%token CYTokenContinue "continue"
-%token CYTokenDefault "default"
-%token CYTokenDelete "delete"
-%token CYTokenDo "do"
-%token CYTokenElse "else"
-%token CYTokenFalse "false"
-%token CYTokenFinally "finally"
-%token CYTokenFor "for"
-%token CYTokenFunction "function"
-%token CYTokenIf "if"
-%token CYTokenIn "in"
-%token CYTokenInstanceOf "instanceof"
-%token CYTokenNew "new"
-%token CYTokenNull "null"
-%token CYTokenReturn "return"
-%token CYTokenSwitch "switch"
-%token CYTokenThis "this"
-%token CYTokenThrow "throw"
-%token CYTokenTrue "true"
-%token CYTokenTry "try"
-%token CYTokenTypeOf "typeof"
-%token CYTokenVar "var"
-%token CYTokenVoid "void"
-%token CYTokenWhile "while"
-%token CYTokenWith "with"
-
-%token CYTokenIdentifier
-%token CYTokenNumber
-%token CYTokenString
+%parse-param { CYDriver &driver }
+%lex-param { void *scanner }
+
+%token At "@"
+
+%token Ampersand "&"
+%token AmpersandAmpersand "&&"
+%token AmpersandEqual "&="
+%token Carrot "^"
+%token CarrotEqual "^="
+%token Equal "="
+%token EqualEqual "=="
+%token EqualEqualEqual "==="
+%token Exclamation "!"
+%token ExclamationEqual "!="
+%token ExclamationEqualEqual "!=="
+%token Hyphen "-"
+%token HyphenEqual "-="
+%token HyphenHyphen "--"
+%token HyphenHyphen_ "\n--"
+%token HyphenRight "->"
+%token Left "<"
+%token LeftEqual "<="
+%token LeftLeft "<<"
+%token LeftLeftEqual "<<="
+%token Percent "%"
+%token PercentEqual "%="
+%token Period "."
+%token Pipe "|"
+%token PipeEqual "|="
+%token PipePipe "||"
+%token Plus "+"
+%token PlusEqual "+="
+%token PlusPlus "++"
+%token PlusPlus_ "\n++"
+%token Right ">"
+%token RightEqual ">="
+%token RightRight ">>"
+%token RightRightEqual ">>="
+%token RightRightRight ">>>"
+%token RightRightRightEqual ">>>="
+%token Slash "/"
+%token SlashEqual "/="
+%token Star "*"
+%token StarEqual "*="
+%token Tilde "~"
+
+%token Colon ":"
+%token Comma ","
+%token Question "?"
+%token SemiColon ";"
+%token NewLine "\n"
+
+%token OpenParen "("
+%token CloseParen ")"
+
+%token OpenBrace "{"
+%token CloseBrace "}"
+
+%token OpenBracket "["
+%token CloseBracket "]"
+
+%token AtClass "@class"
+%token AtSelector "@selector"
+%token AtEnd "@end"
+
+%token <false_> False "false"
+%token <null_> Null "null"
+%token <true_> True "true"
+
+// ES3/ES5/WIE/JSC Reserved
+%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_> If "if"
+%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"
+
+// ES3/IE6 Future, ES5/JSC Reserved
+%token <word_> Debugger "debugger"
+
+// ES3/ES5/IE6 Future, JSC Reserved
+%token <word_> 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"
+
+// ES3 Future, ES5 Strict Future
+%token <identifier_> Implements "implements"
+%token <identifier_> Interface "interface"
+%token <identifier_> Package "package"
+%token <identifier_> Private "private"
+%token <identifier_> Protected "protected"
+%token <identifier_> Public "public"
+%token <identifier_> Static "static"
+
+// ES3 Future
+%token <identifier_> Abstract "abstract"
+%token <identifier_> Boolean "boolean"
+%token <identifier_> Byte "byte"
+%token <identifier_> Char "char"
+%token <identifier_> Double "double"
+%token <identifier_> Final "final"
+%token <identifier_> Float "float"
+%token <identifier_> Goto "goto"
+%token <identifier_> Int "int"
+%token <identifier_> Long "long"
+%token <identifier_> Native "native"
+%token <identifier_> Short "short"
+%token <identifier_> Synchronized "synchronized"
+%token <identifier_> Throws "throws"
+%token <identifier_> Transient "transient"
+%token <identifier_> Volatile "volatile"
+
+// ES5 Strict
+%token <identifier_> Let "let"
+%token <identifier_> Yield "yield"
+
+// Woah?!
+%token <identifier_> Each "each"
+
+%token <identifier_> Identifier_
+%token <number_> NumericLiteral
+%token <string_> StringLiteral
+%token <literal_> RegularExpressionLiteral
+
+%type <expression_> AdditiveExpression
+%type <expression_> AdditiveExpressionNoBF
+%type <argument_> ArgumentList
+%type <argument_> ArgumentList_
+%type <argument_> ArgumentListOpt
+%type <argument_> Arguments
+%type <literal_> ArrayLiteral
+%type <expression_> AssigneeExpression
+%type <expression_> AssigneeExpression_
+%type <expression_> AssigneeExpressionNoBF
+%type <expression_> AssignmentExpression
+%type <assignment_> AssignmentExpression_
+%type <expression_> AssignmentExpressionNoBF
+%type <expression_> AssignmentExpressionNoIn
+%type <expression_> BitwiseANDExpression
+%type <expression_> BitwiseANDExpressionNoBF
+%type <expression_> BitwiseANDExpressionNoIn
+%type <statement_> Block
+%type <statement_> Block_
+%type <boolean_> BooleanLiteral
+%type <expression_> BitwiseORExpression
+%type <expression_> BitwiseORExpressionNoBF
+%type <expression_> BitwiseORExpressionNoIn
+%type <expression_> BitwiseXORExpression
+%type <expression_> BitwiseXORExpressionNoBF
+%type <expression_> BitwiseXORExpressionNoIn
+%type <statement_> BreakStatement
+%type <expression_> CallExpression
+%type <expression_> CallExpressionNoBF
+%type <clause_> CaseBlock
+%type <clause_> CaseClause
+%type <clause_> CaseClausesOpt
+%type <catch_> CatchOpt
+%type <statement_> CategoryStatement
+%type <expression_> ClassExpression
+%type <message_> ClassMessageDeclaration
+%type <message_> ClassMessageDeclarationListOpt
+%type <className_> ClassName
+%type <className_> ClassNameOpt
+%type <statement_> ClassStatement
+%type <expression_> ClassSuperOpt
+%type <field_> ClassFieldList
+%type <comprehension_> ComprehensionList
+%type <comprehension_> ComprehensionListOpt
+%type <expression_> ConditionalExpression
+%type <expression_> ConditionalExpressionNoBF
+%type <expression_> ConditionalExpressionNoIn
+%type <statement_> ContinueStatement
+%type <clause_> DefaultClause
+%type <statement_> DoWhileStatement
+%type <expression_> Element
+%type <expression_> ElementOpt
+%type <element_> ElementList
+%type <element_> ElementListOpt
+%type <statement_> ElseStatementOpt
+%type <statement_> EmptyStatement
+%type <expression_> EqualityExpression
+%type <expression_> EqualityExpressionNoBF
+%type <expression_> EqualityExpressionNoIn
+%type <expression_> Expression
+%type <expression_> ExpressionOpt
+%type <compound_> Expression_
+%type <expression_> ExpressionNoBF
+%type <expression_> ExpressionNoIn
+%type <compound_> ExpressionNoIn_
+%type <expression_> ExpressionNoInOpt
+%type <statement_> ExpressionStatement
+%type <finally_> FinallyOpt
+%type <comprehension_> ForComprehension
+%type <statement_> ForStatement
+%type <for_> ForStatementInitialiser
+%type <statement_> ForInStatement
+%type <forin_> ForInStatementInitialiser
+%type <functionParameter_> FormalParameterList
+%type <functionParameter_> FormalParameterList_
+%type <statement_> FunctionBody
+%type <statement_> FunctionDeclaration
+%type <expression_> FunctionExpression
+%type <identifier_> Identifier
+%type <identifier_> IdentifierOpt
+%type <comprehension_> IfComprehension
+%type <statement_> IfStatement
+%type <expression_> Initialiser
+%type <expression_> InitialiserOpt
+%type <expression_> InitialiserNoIn
+%type <expression_> InitialiserNoInOpt
+%type <statement_> IterationStatement
+%type <statement_> LabelledStatement
+%type <expression_> LeftHandSideExpression
+%type <expression_> LeftHandSideExpressionNoBF
+//%type <statement_> LetStatement
+%type <literal_> Literal
+%type <expression_> LogicalANDExpression
+%type <expression_> LogicalANDExpressionNoBF
+%type <expression_> LogicalANDExpressionNoIn
+%type <expression_> LogicalORExpression
+%type <expression_> LogicalORExpressionNoBF
+%type <expression_> LogicalORExpressionNoIn
+%type <member_> MemberAccess
+%type <expression_> MemberExpression
+%type <expression_> MemberExpression_
+%type <expression_> MemberExpressionNoBF
+%type <messageParameter_> MessageParameter
+%type <messageParameter_> MessageParameters
+%type <messageParameter_> MessageParameterList
+%type <messageParameter_> MessageParameterListOpt
+%type <bool_> MessageScope
+%type <expression_> MultiplicativeExpression
+%type <expression_> MultiplicativeExpressionNoBF
+%type <expression_> NewExpression
+%type <expression_> NewExpression_
+%type <expression_> NewExpressionNoBF
+%type <null_> NullLiteral
+%type <literal_> ObjectLiteral
+%type <expression_> PostfixExpression
+%type <expression_> PostfixExpressionNoBF
+%type <expression_> PrimaryExpression
+%type <expression_> PrimaryExpression_
+%type <expression_> PrimaryExpressionNoBF
+%type <statement_> Program
+%type <propertyName_> PropertyName
+%type <property_> PropertyNameAndValueList
+%type <property_> PropertyNameAndValueList_
+%type <property_> PropertyNameAndValueListOpt
+%type <literal_> RegularExpressionLiteral_
+%type <condition_> RegularExpressionToken
+%type <expression_> RelationalExpression
+%type <infix_> RelationalExpression_
+%type <expression_> RelationalExpressionNoBF
+%type <expression_> RelationalExpressionNoIn
+%type <infix_> RelationalExpressionNoIn_
+%type <statement_> ReturnStatement
+%type <selector_> SelectorExpression
+%type <selector_> SelectorExpression_
+%type <selector_> SelectorExpressionOpt
+%type <expression_> ShiftExpression
+%type <expression_> ShiftExpressionNoBF
+%type <statement_> SourceElement
+%type <statement_> SourceElements
+%type <statement_> Statement
+%type <statement_> Statement_
+%type <statement_> StatementList
+%type <statement_> StatementListOpt
+%type <statement_> SwitchStatement
+%type <statement_> ThrowStatement
+%type <statement_> TryStatement
+%type <expression_> TypeOpt
+%type <expression_> UnaryExpression
+%type <expression_> UnaryExpression_
+%type <expression_> UnaryExpressionNoBF
+%type <declaration_> VariableDeclaration
+%type <declaration_> VariableDeclarationNoIn
+%type <declarations_> VariableDeclarationList
+%type <declarations_> VariableDeclarationList_
+%type <declarations_> VariableDeclarationListNoIn
+%type <declarations_> VariableDeclarationListNoIn_
+%type <statement_> VariableStatement
+%type <statement_> WhileStatement
+%type <statement_> WithStatement
+%type <word_> Word
+%type <word_> WordOpt
+
+%type <expression_> MessageExpression
+%type <argument_> SelectorCall
+%type <argument_> SelectorCall_
+%type <argument_> SelectorList
+%type <argument_> VariadicCall
+
+%left "*" "/" "%"
+%left "+" "-"
+%left "<<" ">>" ">>>"
+%left "<" ">" "<=" ">=" "instanceof" "in"
+%left "==" "!=" "===" "!=="
+%left "&"
+%left "^"
+%left "|"
+%left "&&"
+%left "||"
+
+%right "=" "*=" "/=" "%=" "+=" "-=" "<<=" ">>=" ">>>=" "&=" "^=" "|="
+
+%nonassoc "if"
+%nonassoc "else"
+
+%start Program