packages feed

rtk-0.12: test/golden/java/JavaLexer.x

-- Generated by RTK from grammar 'Java'. Do not edit by hand.
{
{-# LANGUAGE StandaloneDeriving, DeriveDataTypeable #-}
module JavaLexer(scanTokens, alexScanTokens, Token(..), PosToken(..), AlexPosn(..))
where
import Data.Data (Data)

 }
%wrapper "monad"

@exponentPart = ([eE]  ("+"| "-") ?  [0-9]  ([0-9_]*  [0-9]) ?)
@floatTypeSuffix = ([fFdD])
$backslash = [\\]

tokens :- "tok_AdditiveOp_dummy_205" { simple Tk__tok_AdditiveOp_dummy_205 }
          "tok_Annotation_dummy_204" { simple Tk__tok_Annotation_dummy_204 }
          "tok_AnnotationArguments_dummy_203" { simple Tk__tok_AnnotationArguments_dummy_203 }
          "tok_AnnotationDeclaration_dummy_202" { simple Tk__tok_AnnotationDeclaration_dummy_202 }
          "tok_AnnotationElement_dummy_201" { simple Tk__tok_AnnotationElement_dummy_201 }
          "tok_AnnotationList_dummy_200" { simple Tk__tok_AnnotationList_dummy_200 }
          "tok_AnnotationTypeElement_dummy_199" { simple Tk__tok_AnnotationTypeElement_dummy_199 }
          "tok_AnnotationTypeElementList_dummy_198" { simple Tk__tok_AnnotationTypeElementList_dummy_198 }
          "tok_Arglist_dummy_197" { simple Tk__tok_Arglist_dummy_197 }
          "tok_ArrayInitializer_dummy_196" { simple Tk__tok_ArrayInitializer_dummy_196 }
          "tok_AssignmentOp_dummy_195" { simple Tk__tok_AssignmentOp_dummy_195 }
          "tok_CatchList_dummy_194" { simple Tk__tok_CatchList_dummy_194 }
          "tok_CatchParameter_dummy_193" { simple Tk__tok_CatchParameter_dummy_193 }
          "tok_ClassDeclaration_dummy_192" { simple Tk__tok_ClassDeclaration_dummy_192 }
          "tok_ClassOrInterfaceType_dummy_191" { simple Tk__tok_ClassOrInterfaceType_dummy_191 }
          "tok_CompilationUnit_dummy_190" { simple Tk__tok_CompilationUnit_dummy_190 }
          "tok_CompilationUnitRest_dummy_189" { simple Tk__tok_CompilationUnitRest_dummy_189 }
          "tok_CompoundName_dummy_188" { simple Tk__tok_CompoundName_dummy_188 }
          "tok_CompoundNameTail_dummy_187" { simple Tk__tok_CompoundNameTail_dummy_187 }
          "tok_CreationExpression_dummy_186" { simple Tk__tok_CreationExpression_dummy_186 }
          "tok_DimExprs_dummy_185" { simple Tk__tok_DimExprs_dummy_185 }
          "tok_Dims_dummy_184" { simple Tk__tok_Dims_dummy_184 }
          "tok_DoStatement_dummy_183" { simple Tk__tok_DoStatement_dummy_183 }
          "tok_DocComment_dummy_182" { simple Tk__tok_DocComment_dummy_182 }
          "tok_ElementValue_dummy_181" { simple Tk__tok_ElementValue_dummy_181 }
          "tok_ElementValueArrayInitializer_dummy_180" { simple Tk__tok_ElementValueArrayInitializer_dummy_180 }
          "tok_EnumConstant_dummy_179" { simple Tk__tok_EnumConstant_dummy_179 }
          "tok_EnumConstantList_dummy_178" { simple Tk__tok_EnumConstantList_dummy_178 }
          "tok_EnumDeclaration_dummy_177" { simple Tk__tok_EnumDeclaration_dummy_177 }
          "tok_EqualityOp_dummy_176" { simple Tk__tok_EqualityOp_dummy_176 }
          "tok_Expression_dummy_175" { simple Tk__tok_Expression_dummy_175 }
          "tok_ExtendsList_dummy_174" { simple Tk__tok_ExtendsList_dummy_174 }
          "tok_FieldDeclaration_dummy_173" { simple Tk__tok_FieldDeclaration_dummy_173 }
          "tok_FieldDeclarationList_dummy_172" { simple Tk__tok_FieldDeclarationList_dummy_172 }
          "tok_ForEachHeader_dummy_171" { simple Tk__tok_ForEachHeader_dummy_171 }
          "tok_ForStatement_dummy_170" { simple Tk__tok_ForStatement_dummy_170 }
          "tok_IfStatement_dummy_169" { simple Tk__tok_IfStatement_dummy_169 }
          "tok_ImplementsList_dummy_168" { simple Tk__tok_ImplementsList_dummy_168 }
          "tok_ImportHead_dummy_167" { simple Tk__tok_ImportHead_dummy_167 }
          "tok_ImportList_dummy_166" { simple Tk__tok_ImportList_dummy_166 }
          "tok_ImportName_dummy_165" { simple Tk__tok_ImportName_dummy_165 }
          "tok_ImportStatement_dummy_164" { simple Tk__tok_ImportStatement_dummy_164 }
          "tok_InterfaceDeclaration_dummy_163" { simple Tk__tok_InterfaceDeclaration_dummy_163 }
          "tok_Java_dummy_206" { simple Tk__tok_Java_dummy_206 }
          "tok_LambdaBody_dummy_162" { simple Tk__tok_LambdaBody_dummy_162 }
          "tok_Literal_dummy_161" { simple Tk__tok_Literal_dummy_161 }
          "tok_LocalModifierList1_dummy_160" { simple Tk__tok_LocalModifierList1_dummy_160 }
          "tok_MemberAfterFirstId_dummy_159" { simple Tk__tok_MemberAfterFirstId_dummy_159 }
          "tok_MemberDeclaration_dummy_158" { simple Tk__tok_MemberDeclaration_dummy_158 }
          "tok_MemberRest_dummy_157" { simple Tk__tok_MemberRest_dummy_157 }
          "tok_Modifier_dummy_156" { simple Tk__tok_Modifier_dummy_156 }
          "tok_ModifierList_dummy_155" { simple Tk__tok_ModifierList_dummy_155 }
          "tok_MoreTypeSpecifier_dummy_154" { simple Tk__tok_MoreTypeSpecifier_dummy_154 }
          "tok_MoreVariableDeclarators_dummy_153" { simple Tk__tok_MoreVariableDeclarators_dummy_153 }
          "tok_MultiplicativeOp_dummy_152" { simple Tk__tok_MultiplicativeOp_dummy_152 }
          "tok_NonEmptyDims_dummy_151" { simple Tk__tok_NonEmptyDims_dummy_151 }
          "tok_NonEmptyTypeArguments_dummy_150" { simple Tk__tok_NonEmptyTypeArguments_dummy_150 }
          "tok_NonEmptyTypeParameters_dummy_149" { simple Tk__tok_NonEmptyTypeParameters_dummy_149 }
          "tok_OptDocComment_dummy_148" { simple Tk__tok_OptDocComment_dummy_148 }
          "tok_OptElsePart_dummy_147" { simple Tk__tok_OptElsePart_dummy_147 }
          "tok_OptExpression_dummy_146" { simple Tk__tok_OptExpression_dummy_146 }
          "tok_OptFinally_dummy_145" { simple Tk__tok_OptFinally_dummy_145 }
          "tok_OptId_dummy_144" { simple Tk__tok_OptId_dummy_144 }
          "tok_OptVariableInitializer_dummy_143" { simple Tk__tok_OptVariableInitializer_dummy_143 }
          "tok_Package_dummy_142" { simple Tk__tok_Package_dummy_142 }
          "tok_ParamModifierList_dummy_141" { simple Tk__tok_ParamModifierList_dummy_141 }
          "tok_Parameter_dummy_140" { simple Tk__tok_Parameter_dummy_140 }
          "tok_ParameterList_dummy_139" { simple Tk__tok_ParameterList_dummy_139 }
          "tok_PostfixOp_dummy_138" { simple Tk__tok_PostfixOp_dummy_138 }
          "tok_PrefixOp_dummy_137" { simple Tk__tok_PrefixOp_dummy_137 }
          "tok_PrimitiveTypeKeyword_dummy_136" { simple Tk__tok_PrimitiveTypeKeyword_dummy_136 }
          "tok_RelationalOp_dummy_135" { simple Tk__tok_RelationalOp_dummy_135 }
          "tok_Resource_dummy_134" { simple Tk__tok_Resource_dummy_134 }
          "tok_ResourceSpec_dummy_133" { simple Tk__tok_ResourceSpec_dummy_133 }
          "tok_ShiftOp_dummy_132" { simple Tk__tok_ShiftOp_dummy_132 }
          "tok_Statement_dummy_131" { simple Tk__tok_Statement_dummy_131 }
          "tok_StatementBlock_dummy_130" { simple Tk__tok_StatementBlock_dummy_130 }
          "tok_StatementList_dummy_129" { simple Tk__tok_StatementList_dummy_129 }
          "tok_StaticInitializer_dummy_128" { simple Tk__tok_StaticInitializer_dummy_128 }
          "tok_SwitchCaseList_dummy_127" { simple Tk__tok_SwitchCaseList_dummy_127 }
          "tok_SwitchStatement_dummy_126" { simple Tk__tok_SwitchStatement_dummy_126 }
          "tok_ThrowsClause_dummy_125" { simple Tk__tok_ThrowsClause_dummy_125 }
          "tok_TryStatement_dummy_124" { simple Tk__tok_TryStatement_dummy_124 }
          "tok_Type_dummy_123" { simple Tk__tok_Type_dummy_123 }
          "tok_TypeArgument_dummy_122" { simple Tk__tok_TypeArgument_dummy_122 }
          "tok_TypeArguments_dummy_121" { simple Tk__tok_TypeArguments_dummy_121 }
          "tok_TypeDeclRest_dummy_120" { simple Tk__tok_TypeDeclRest_dummy_120 }
          "tok_TypeDeclaration_dummy_119" { simple Tk__tok_TypeDeclaration_dummy_119 }
          "tok_TypeDeclarationList_dummy_118" { simple Tk__tok_TypeDeclarationList_dummy_118 }
          "tok_TypeParameter_dummy_117" { simple Tk__tok_TypeParameter_dummy_117 }
          "tok_TypeParameters_dummy_116" { simple Tk__tok_TypeParameters_dummy_116 }
          "tok_TypeSpecifier_dummy_115" { simple Tk__tok_TypeSpecifier_dummy_115 }
          "tok_VariableDeclaration_dummy_114" { simple Tk__tok_VariableDeclaration_dummy_114 }
          "tok_VariableDeclarator_dummy_113" { simple Tk__tok_VariableDeclarator_dummy_113 }
          "tok_VariableDeclaratorList_dummy_112" { simple Tk__tok_VariableDeclaratorList_dummy_112 }
          "tok_VariableInitializer_dummy_111" { simple Tk__tok_VariableInitializer_dummy_111 }
          "tok_VariableInitializerList_dummy_110" { simple Tk__tok_VariableInitializerList_dummy_110 }
          "tok_WhileStatement_dummy_109" { simple Tk__tok_WhileStatement_dummy_109 }
          "tok_WildcardType_dummy_108" { simple Tk__tok_WildcardType_dummy_108 }
          "~" { simple Tk__tok__tilde__84 }
          "}" { simple Tk__tok__symbol__12 }
          "||" { simple Tk__tok__pipe__pipe__66 }
          "|=" { simple Tk__tok__pipe__eql__58 }
          "|" { simple Tk__tok__pipe__48 }
          "{" { simple Tk__tok__symbol__11 }
          "while" { simple Tk__tok_while_45 }
          "void" { simple Tk__tok_void_28 }
          "try" { simple Tk__tok_try_50 }
          "true" { simple Tk__tok_true_88 }
          "transient" { simple Tk__tok_transient_97 }
          "throws" { simple Tk__tok_throws_29 }
          "throw" { simple Tk__tok_throw_35 }
          "threadsafe" { simple Tk__tok_threadsafe_96 }
          "this" { simple Tk__tok_this_41 }
          "synchronized" { simple Tk__tok_synchronized_34 }
          "switch" { simple Tk__tok_switch_52 }
          "super" { simple Tk__tok_super_40 }
          "static" { simple Tk__tok_static_3 }
          "short" { simple Tk__tok_short_23 }
          "return" { simple Tk__tok_return_33 }
          "public" { simple Tk__tok_public_91 }
          "protected" { simple Tk__tok_protected_93 }
          "private" { simple Tk__tok_private_92 }
          "package" { simple Tk__tok_package_0 }
          "null" { simple Tk__tok_null_90 }
          "new" { simple Tk__tok_new_87 }
          "native" { simple Tk__tok_native_94 }
          "long" { simple Tk__tok_long_26 }
          "interface" { simple Tk__tok_interface_16 }
          "int" { simple Tk__tok_int_24 }
          "instanceof" { simple Tk__tok_instanceof_76 }
          "import" { simple Tk__tok_import_2 }
          "implements" { simple Tk__tok_implements_14 }
          "if" { simple Tk__tok_if_43 }
          "for" { simple Tk__tok_for_46 }
          "float" { simple Tk__tok_float_25 }
          "finally" { simple Tk__tok_finally_49 }
          "final" { simple Tk__tok_final_31 }
          "false" { simple Tk__tok_false_89 }
          "extends" { simple Tk__tok_extends_13 }
          "enum" { simple Tk__tok_enum_17 }
          "else" { simple Tk__tok_else_42 }
          "double" { simple Tk__tok_double_27 }
          "do" { simple Tk__tok_do_44 }
          "default" { simple Tk__tok_default_30 }
          "continue" { simple Tk__tok_continue_39 }
          "class" { simple Tk__tok_class_15 }
          "char" { simple Tk__tok_char_22 }
          "catch" { simple Tk__tok_catch_47 }
          "case" { simple Tk__tok_case_51 }
          "byte" { simple Tk__tok_byte_21 }
          "break" { simple Tk__tok_break_38 }
          "boolean" { simple Tk__tok_boolean_20 }
          "assert" { simple Tk__tok_assert_36 }
          "abstract" { simple Tk__tok_abstract_95 }
          "^=" { simple Tk__tok__symbol__eql__60 }
          "^" { simple Tk__tok__symbol__68 }
          "]" { simple Tk__tok__sq_bkt_r__19 }
          "[" { simple Tk__tok__sq_bkt_l__18 }
          "@" { simple Tk__tok__symbol__6 }
          "?" { simple Tk__tok__symbol__65 }
          ">>>=" { simple Tk__tok__symbol__symbol__symbol__eql__64 }
          ">>=" { simple Tk__tok__symbol__symbol__eql__63 }
          ">=" { simple Tk__tok__symbol__eql__75 }
          ">" { simple Tk__tok__symbol__73 }
          "==" { simple Tk__tok__eql__eql__70 }
          "=" { simple Tk__tok__eql__10 }
          "<=" { simple Tk__tok__symbol__eql__74 }
          "<<=" { simple Tk__tok__symbol__symbol__eql__62 }
          "<<" { simple Tk__tok__symbol__symbol__77 }
          "<" { simple Tk__tok__symbol__72 }
          ";" { simple Tk__tok__semi__1 }
          "::" { simple Tk__tok__colon__colon__86 }
          ":" { simple Tk__tok__colon__37 }
          "/=" { simple Tk__tok__symbol__eql__57 }
          "/" { simple Tk__tok__symbol__80 }
          "..." { simple Tk__tok__dot__dot__dot__32 }
          "." { simple Tk__tok__dot__4 }
          "->" { simple Tk__tok__minus__symbol__53 }
          "-=" { simple Tk__tok__minus__eql__55 }
          "--" { simple Tk__tok__minus__minus__83 }
          "-" { simple Tk__tok__minus__79 }
          "," { simple Tk__tok__coma__9 }
          "+=" { simple Tk__tok__plus__eql__54 }
          "++" { simple Tk__tok__plus__plus__82 }
          "+" { simple Tk__tok__plus__78 }
          "*=" { simple Tk__tok__star__eql__56 }
          "*" { simple Tk__tok__star__5 }
          ")" { simple Tk__tok__rparen__8 }
          "(" { simple Tk__tok__lparen__7 }
          "&=" { simple Tk__tok__symbol__eql__59 }
          "&&" { simple Tk__tok__symbol__symbol__67 }
          "&" { simple Tk__tok__symbol__69 }
          "%=" { simple Tk__tok__symbol__eql__61 }
          "%" { simple Tk__tok__symbol__81 }
          "!=" { simple Tk__tok__exclamation__eql__71 }
          "!" { simple Tk__tok__exclamation__85 }
          ("/*"  ([^\*\n]| [\n])  ([\n]| [^\*\n]| [\*]  [^\/\n]| [\*]  [\n])*  "*/") ;
          ("//"  [^\n]*  \n) ;
          ([\ \t\n\r]+) ;
          ("/**"  ([\n]| [^\*\n]| [\*]  [^\/\n]| [\*]  [\n])*  "*/") { simple1 $  Tk__doccomment . (id) }
          ([a-zA-Z\$_]  [a-zA-Z\$_0-9]*) { simple1 $  Tk__id . (id) }
          ([\"]  ([^\"\\\n\r]| $backslash  .)*  [\"]) { simple1 $  Tk__string . (id) }
          ("'"  .  "'"| "'"  $backslash  .  "'"| "'"  $backslash  [0-7]  [0-7]  "'"| "'"  $backslash  [0-3]  [0-7]  [0-7]  "'"| "'"  $backslash  "u"  [0-9a-fA-F]  [0-9a-fA-F]  [0-9a-fA-F]  [0-9a-fA-F]  "'") { simple1 $  Tk__char . (id) }
          ([fFdD]) { simple1 $  Tk__floatTypeSuffix . (id) }
          ([eE]  ("+"| "-") ?  [0-9]  ([0-9_]*  [0-9]) ?) { simple1 $  Tk__exponentPart . (id) }
          ([0-9]  ([0-9_]*  [0-9]) ?  "."  ([0-9]  ([0-9_]*  [0-9]) ?) ?  @exponentPart ?  @floatTypeSuffix ?| "."  [0-9]  ([0-9_]*  [0-9]) ?  @exponentPart ?  @floatTypeSuffix ?| [0-9]  ([0-9_]*  [0-9]) ?  @exponentPart  @floatTypeSuffix ?| [0-9]  ([0-9_]*  [0-9]) ?  @floatTypeSuffix) { simple1 $  Tk__floatLiteral . (id) }
          (([0-9]  ([0-9_]*  [0-9]) ?| "0"  [xX]  [0-9a-fA-F]  ([0-9a-fA-F_]*  [0-9a-fA-F]) ?| "0"  [bB]  [01]  ([01_]*  [01]) ?)  [lL] ?) { simple1 $  Tk__integerLiteral . (id) }
          ("$"  "CompoundName"  ":"  [a-zA-Z_]  [A-Za-z0-9_]*) { simple1 $  Tk__qq_CompoundName . ((tail . dropWhile (/= ':'))) }
          ("$"  "CompoundNameTail"  ":"  [a-zA-Z_]  [A-Za-z0-9_]*) { simple1 $  Tk__qq_CompoundNameTail . ((tail . dropWhile (/= ':'))) }
          ("$"  "Modifier"  ":"  [a-zA-Z_]  [A-Za-z0-9_]*) { simple1 $  Tk__qq_Modifier . ((tail . dropWhile (/= ':'))) }
          ("$"  "TypeSpecifier"  ":"  [a-zA-Z_]  [A-Za-z0-9_]*) { simple1 $  Tk__qq_TypeSpecifier . ((tail . dropWhile (/= ':'))) }
          ("$"  "Type"  ":"  [a-zA-Z_]  [A-Za-z0-9_]*) { simple1 $  Tk__qq_Type . ((tail . dropWhile (/= ':'))) }
          ("$"  "TypeParameter"  ":"  [a-zA-Z_]  [A-Za-z0-9_]*) { simple1 $  Tk__qq_TypeParameter . ((tail . dropWhile (/= ':'))) }
          ("$"  "NonEmptyTypeParameters"  ":"  [a-zA-Z_]  [A-Za-z0-9_]*) { simple1 $  Tk__qq_NonEmptyTypeParameters . ((tail . dropWhile (/= ':'))) }
          ("$"  "TypeParameters"  ":"  [a-zA-Z_]  [A-Za-z0-9_]*) { simple1 $  Tk__qq_TypeParameters . ((tail . dropWhile (/= ':'))) }
          ("$"  "WildcardType"  ":"  [a-zA-Z_]  [A-Za-z0-9_]*) { simple1 $  Tk__qq_WildcardType . ((tail . dropWhile (/= ':'))) }
          ("$"  "TypeArgument"  ":"  [a-zA-Z_]  [A-Za-z0-9_]*) { simple1 $  Tk__qq_TypeArgument . ((tail . dropWhile (/= ':'))) }
          ("$"  "NonEmptyTypeArguments"  ":"  [a-zA-Z_]  [A-Za-z0-9_]*) { simple1 $  Tk__qq_NonEmptyTypeArguments . ((tail . dropWhile (/= ':'))) }
          ("$"  "TypeArguments"  ":"  [a-zA-Z_]  [A-Za-z0-9_]*) { simple1 $  Tk__qq_TypeArguments . ((tail . dropWhile (/= ':'))) }
          ("$"  "Arglist"  ":"  [a-zA-Z_]  [A-Za-z0-9_]*) { simple1 $  Tk__qq_Arglist . ((tail . dropWhile (/= ':'))) }
          ("$"  "Literal"  ":"  [a-zA-Z_]  [A-Za-z0-9_]*) { simple1 $  Tk__qq_Literal . ((tail . dropWhile (/= ':'))) }
          ("$"  "DimExprs"  ":"  [a-zA-Z_]  [A-Za-z0-9_]*) { simple1 $  Tk__qq_DimExprs . ((tail . dropWhile (/= ':'))) }
          ("$"  "CreationExpression"  ":"  [a-zA-Z_]  [A-Za-z0-9_]*) { simple1 $  Tk__qq_CreationExpression . ((tail . dropWhile (/= ':'))) }
          ("$"  "PostfixOp"  ":"  [a-zA-Z_]  [A-Za-z0-9_]*) { simple1 $  Tk__qq_PostfixOp . ((tail . dropWhile (/= ':'))) }
          ("$"  "PrefixOp"  ":"  [a-zA-Z_]  [A-Za-z0-9_]*) { simple1 $  Tk__qq_PrefixOp . ((tail . dropWhile (/= ':'))) }
          ("$"  "MultiplicativeOp"  ":"  [a-zA-Z_]  [A-Za-z0-9_]*) { simple1 $  Tk__qq_MultiplicativeOp . ((tail . dropWhile (/= ':'))) }
          ("$"  "AdditiveOp"  ":"  [a-zA-Z_]  [A-Za-z0-9_]*) { simple1 $  Tk__qq_AdditiveOp . ((tail . dropWhile (/= ':'))) }
          ("$"  "ShiftOp"  ":"  [a-zA-Z_]  [A-Za-z0-9_]*) { simple1 $  Tk__qq_ShiftOp . ((tail . dropWhile (/= ':'))) }
          ("$"  "RelationalOp"  ":"  [a-zA-Z_]  [A-Za-z0-9_]*) { simple1 $  Tk__qq_RelationalOp . ((tail . dropWhile (/= ':'))) }
          ("$"  "EqualityOp"  ":"  [a-zA-Z_]  [A-Za-z0-9_]*) { simple1 $  Tk__qq_EqualityOp . ((tail . dropWhile (/= ':'))) }
          ("$"  "AssignmentOp"  ":"  [a-zA-Z_]  [A-Za-z0-9_]*) { simple1 $  Tk__qq_AssignmentOp . ((tail . dropWhile (/= ':'))) }
          ("$"  "LambdaBody"  ":"  [a-zA-Z_]  [A-Za-z0-9_]*) { simple1 $  Tk__qq_LambdaBody . ((tail . dropWhile (/= ':'))) }
          ("$"  "Expression"  ":"  [a-zA-Z_]  [A-Za-z0-9_]*) { simple1 $  Tk__qq_Expression . ((tail . dropWhile (/= ':'))) }
          ("$"  "SwitchStatement"  ":"  [a-zA-Z_]  [A-Za-z0-9_]*) { simple1 $  Tk__qq_SwitchStatement . ((tail . dropWhile (/= ':'))) }
          ("$"  "SwitchCaseList"  ":"  [a-zA-Z_]  [A-Za-z0-9_]*) { simple1 $  Tk__qq_SwitchCaseList . ((tail . dropWhile (/= ':'))) }
          ("$"  "Resource"  ":"  [a-zA-Z_]  [A-Za-z0-9_]*) { simple1 $  Tk__qq_Resource . ((tail . dropWhile (/= ':'))) }
          ("$"  "ResourceSpec"  ":"  [a-zA-Z_]  [A-Za-z0-9_]*) { simple1 $  Tk__qq_ResourceSpec . ((tail . dropWhile (/= ':'))) }
          ("$"  "TryStatement"  ":"  [a-zA-Z_]  [A-Za-z0-9_]*) { simple1 $  Tk__qq_TryStatement . ((tail . dropWhile (/= ':'))) }
          ("$"  "OptFinally"  ":"  [a-zA-Z_]  [A-Za-z0-9_]*) { simple1 $  Tk__qq_OptFinally . ((tail . dropWhile (/= ':'))) }
          ("$"  "CatchParameter"  ":"  [a-zA-Z_]  [A-Za-z0-9_]*) { simple1 $  Tk__qq_CatchParameter . ((tail . dropWhile (/= ':'))) }
          ("$"  "CatchList"  ":"  [a-zA-Z_]  [A-Za-z0-9_]*) { simple1 $  Tk__qq_CatchList . ((tail . dropWhile (/= ':'))) }
          ("$"  "ForEachHeader"  ":"  [a-zA-Z_]  [A-Za-z0-9_]*) { simple1 $  Tk__qq_ForEachHeader . ((tail . dropWhile (/= ':'))) }
          ("$"  "ForStatement"  ":"  [a-zA-Z_]  [A-Za-z0-9_]*) { simple1 $  Tk__qq_ForStatement . ((tail . dropWhile (/= ':'))) }
          ("$"  "WhileStatement"  ":"  [a-zA-Z_]  [A-Za-z0-9_]*) { simple1 $  Tk__qq_WhileStatement . ((tail . dropWhile (/= ':'))) }
          ("$"  "DoStatement"  ":"  [a-zA-Z_]  [A-Za-z0-9_]*) { simple1 $  Tk__qq_DoStatement . ((tail . dropWhile (/= ':'))) }
          ("$"  "IfStatement"  ":"  [a-zA-Z_]  [A-Za-z0-9_]*) { simple1 $  Tk__qq_IfStatement . ((tail . dropWhile (/= ':'))) }
          ("$"  "OptElsePart"  ":"  [a-zA-Z_]  [A-Za-z0-9_]*) { simple1 $  Tk__qq_OptElsePart . ((tail . dropWhile (/= ':'))) }
          ("$"  "Statement"  ":"  [a-zA-Z_]  [A-Za-z0-9_]*) { simple1 $  Tk__qq_Statement . ((tail . dropWhile (/= ':'))) }
          ("$"  "OptId"  ":"  [a-zA-Z_]  [A-Za-z0-9_]*) { simple1 $  Tk__qq_OptId . ((tail . dropWhile (/= ':'))) }
          ("$"  "OptExpression"  ":"  [a-zA-Z_]  [A-Za-z0-9_]*) { simple1 $  Tk__qq_OptExpression . ((tail . dropWhile (/= ':'))) }
          ("$"  "StatementList"  ":"  [a-zA-Z_]  [A-Za-z0-9_]*) { simple1 $  Tk__qq_StatementList . ((tail . dropWhile (/= ':'))) }
          ("$"  "Parameter"  ":"  [a-zA-Z_]  [A-Za-z0-9_]*) { simple1 $  Tk__qq_Parameter . ((tail . dropWhile (/= ':'))) }
          ("$"  "ParamModifierList"  ":"  [a-zA-Z_]  [A-Za-z0-9_]*) { simple1 $  Tk__qq_ParamModifierList . ((tail . dropWhile (/= ':'))) }
          ("$"  "ParameterList"  ":"  [a-zA-Z_]  [A-Za-z0-9_]*) { simple1 $  Tk__qq_ParameterList . ((tail . dropWhile (/= ':'))) }
          ("$"  "StaticInitializer"  ":"  [a-zA-Z_]  [A-Za-z0-9_]*) { simple1 $  Tk__qq_StaticInitializer . ((tail . dropWhile (/= ':'))) }
          ("$"  "ArrayInitializer"  ":"  [a-zA-Z_]  [A-Za-z0-9_]*) { simple1 $  Tk__qq_ArrayInitializer . ((tail . dropWhile (/= ':'))) }
          ("$"  "VariableInitializer"  ":"  [a-zA-Z_]  [A-Za-z0-9_]*) { simple1 $  Tk__qq_VariableInitializer . ((tail . dropWhile (/= ':'))) }
          ("$"  "VariableInitializerList"  ":"  [a-zA-Z_]  [A-Za-z0-9_]*) { simple1 $  Tk__qq_VariableInitializerList . ((tail . dropWhile (/= ':'))) }
          ("$"  "VariableDeclarator"  ":"  [a-zA-Z_]  [A-Za-z0-9_]*) { simple1 $  Tk__qq_VariableDeclarator . ((tail . dropWhile (/= ':'))) }
          ("$"  "OptVariableInitializer"  ":"  [a-zA-Z_]  [A-Za-z0-9_]*) { simple1 $  Tk__qq_OptVariableInitializer . ((tail . dropWhile (/= ':'))) }
          ("$"  "LocalModifierList1"  ":"  [a-zA-Z_]  [A-Za-z0-9_]*) { simple1 $  Tk__qq_LocalModifierList1 . ((tail . dropWhile (/= ':'))) }
          ("$"  "VariableDeclaration"  ":"  [a-zA-Z_]  [A-Za-z0-9_]*) { simple1 $  Tk__qq_VariableDeclaration . ((tail . dropWhile (/= ':'))) }
          ("$"  "VariableDeclaratorList"  ":"  [a-zA-Z_]  [A-Za-z0-9_]*) { simple1 $  Tk__qq_VariableDeclaratorList . ((tail . dropWhile (/= ':'))) }
          ("$"  "StatementBlock"  ":"  [a-zA-Z_]  [A-Za-z0-9_]*) { simple1 $  Tk__qq_StatementBlock . ((tail . dropWhile (/= ':'))) }
          ("$"  "MoreVariableDeclarators"  ":"  [a-zA-Z_]  [A-Za-z0-9_]*) { simple1 $  Tk__qq_MoreVariableDeclarators . ((tail . dropWhile (/= ':'))) }
          ("$"  "MemberRest"  ":"  [a-zA-Z_]  [A-Za-z0-9_]*) { simple1 $  Tk__qq_MemberRest . ((tail . dropWhile (/= ':'))) }
          ("$"  "ThrowsClause"  ":"  [a-zA-Z_]  [A-Za-z0-9_]*) { simple1 $  Tk__qq_ThrowsClause . ((tail . dropWhile (/= ':'))) }
          ("$"  "MoreTypeSpecifier"  ":"  [a-zA-Z_]  [A-Za-z0-9_]*) { simple1 $  Tk__qq_MoreTypeSpecifier . ((tail . dropWhile (/= ':'))) }
          ("$"  "MemberAfterFirstId"  ":"  [a-zA-Z_]  [A-Za-z0-9_]*) { simple1 $  Tk__qq_MemberAfterFirstId . ((tail . dropWhile (/= ':'))) }
          ("$"  "PrimitiveTypeKeyword"  ":"  [a-zA-Z_]  [A-Za-z0-9_]*) { simple1 $  Tk__qq_PrimitiveTypeKeyword . ((tail . dropWhile (/= ':'))) }
          ("$"  "MemberDeclaration"  ":"  [a-zA-Z_]  [A-Za-z0-9_]*) { simple1 $  Tk__qq_MemberDeclaration . ((tail . dropWhile (/= ':'))) }
          ("$"  "NonEmptyDims"  ":"  [a-zA-Z_]  [A-Za-z0-9_]*) { simple1 $  Tk__qq_NonEmptyDims . ((tail . dropWhile (/= ':'))) }
          ("$"  "Dims"  ":"  [a-zA-Z_]  [A-Za-z0-9_]*) { simple1 $  Tk__qq_Dims . ((tail . dropWhile (/= ':'))) }
          ("$"  "FieldDeclaration"  ":"  [a-zA-Z_]  [A-Za-z0-9_]*) { simple1 $  Tk__qq_FieldDeclaration . ((tail . dropWhile (/= ':'))) }
          ("$"  "TypeDeclRest"  ":"  [a-zA-Z_]  [A-Za-z0-9_]*) { simple1 $  Tk__qq_TypeDeclRest . ((tail . dropWhile (/= ':'))) }
          ("$"  "EnumDeclaration"  ":"  [a-zA-Z_]  [A-Za-z0-9_]*) { simple1 $  Tk__qq_EnumDeclaration . ((tail . dropWhile (/= ':'))) }
          ("$"  "EnumConstantList"  ":"  [a-zA-Z_]  [A-Za-z0-9_]*) { simple1 $  Tk__qq_EnumConstantList . ((tail . dropWhile (/= ':'))) }
          ("$"  "EnumConstant"  ":"  [a-zA-Z_]  [A-Za-z0-9_]*) { simple1 $  Tk__qq_EnumConstant . ((tail . dropWhile (/= ':'))) }
          ("$"  "AnnotationTypeElement"  ":"  [a-zA-Z_]  [A-Za-z0-9_]*) { simple1 $  Tk__qq_AnnotationTypeElement . ((tail . dropWhile (/= ':'))) }
          ("$"  "AnnotationTypeElementList"  ":"  [a-zA-Z_]  [A-Za-z0-9_]*) { simple1 $  Tk__qq_AnnotationTypeElementList . ((tail . dropWhile (/= ':'))) }
          ("$"  "AnnotationDeclaration"  ":"  [a-zA-Z_]  [A-Za-z0-9_]*) { simple1 $  Tk__qq_AnnotationDeclaration . ((tail . dropWhile (/= ':'))) }
          ("$"  "InterfaceDeclaration"  ":"  [a-zA-Z_]  [A-Za-z0-9_]*) { simple1 $  Tk__qq_InterfaceDeclaration . ((tail . dropWhile (/= ':'))) }
          ("$"  "ClassDeclaration"  ":"  [a-zA-Z_]  [A-Za-z0-9_]*) { simple1 $  Tk__qq_ClassDeclaration . ((tail . dropWhile (/= ':'))) }
          ("$"  "FieldDeclarationList"  ":"  [a-zA-Z_]  [A-Za-z0-9_]*) { simple1 $  Tk__qq_FieldDeclarationList . ((tail . dropWhile (/= ':'))) }
          ("$"  "ImplementsList"  ":"  [a-zA-Z_]  [A-Za-z0-9_]*) { simple1 $  Tk__qq_ImplementsList . ((tail . dropWhile (/= ':'))) }
          ("$"  "ExtendsList"  ":"  [a-zA-Z_]  [A-Za-z0-9_]*) { simple1 $  Tk__qq_ExtendsList . ((tail . dropWhile (/= ':'))) }
          ("$"  "ClassOrInterfaceType"  ":"  [a-zA-Z_]  [A-Za-z0-9_]*) { simple1 $  Tk__qq_ClassOrInterfaceType . ((tail . dropWhile (/= ':'))) }
          ("$"  "ModifierList"  ":"  [a-zA-Z_]  [A-Za-z0-9_]*) { simple1 $  Tk__qq_ModifierList . ((tail . dropWhile (/= ':'))) }
          ("$"  "AnnotationList"  ":"  [a-zA-Z_]  [A-Za-z0-9_]*) { simple1 $  Tk__qq_AnnotationList . ((tail . dropWhile (/= ':'))) }
          ("$"  "ElementValueArrayInitializer"  ":"  [a-zA-Z_]  [A-Za-z0-9_]*) { simple1 $  Tk__qq_ElementValueArrayInitializer . ((tail . dropWhile (/= ':'))) }
          ("$"  "ElementValue"  ":"  [a-zA-Z_]  [A-Za-z0-9_]*) { simple1 $  Tk__qq_ElementValue . ((tail . dropWhile (/= ':'))) }
          ("$"  "AnnotationElement"  ":"  [a-zA-Z_]  [A-Za-z0-9_]*) { simple1 $  Tk__qq_AnnotationElement . ((tail . dropWhile (/= ':'))) }
          ("$"  "AnnotationArguments"  ":"  [a-zA-Z_]  [A-Za-z0-9_]*) { simple1 $  Tk__qq_AnnotationArguments . ((tail . dropWhile (/= ':'))) }
          ("$"  "Annotation"  ":"  [a-zA-Z_]  [A-Za-z0-9_]*) { simple1 $  Tk__qq_Annotation . ((tail . dropWhile (/= ':'))) }
          ("$"  "DocComment"  ":"  [a-zA-Z_]  [A-Za-z0-9_]*) { simple1 $  Tk__qq_DocComment . ((tail . dropWhile (/= ':'))) }
          ("$"  "ImportHead"  ":"  [a-zA-Z_]  [A-Za-z0-9_]*) { simple1 $  Tk__qq_ImportHead . ((tail . dropWhile (/= ':'))) }
          ("$"  "ImportName"  ":"  [a-zA-Z_]  [A-Za-z0-9_]*) { simple1 $  Tk__qq_ImportName . ((tail . dropWhile (/= ':'))) }
          ("$"  "ImportStatement"  ":"  [a-zA-Z_]  [A-Za-z0-9_]*) { simple1 $  Tk__qq_ImportStatement . ((tail . dropWhile (/= ':'))) }
          ("$"  "Package"  ":"  [a-zA-Z_]  [A-Za-z0-9_]*) { simple1 $  Tk__qq_Package . ((tail . dropWhile (/= ':'))) }
          ("$"  "CompilationUnitRest"  ":"  [a-zA-Z_]  [A-Za-z0-9_]*) { simple1 $  Tk__qq_CompilationUnitRest . ((tail . dropWhile (/= ':'))) }
          ("$"  "CompilationUnit"  ":"  [a-zA-Z_]  [A-Za-z0-9_]*) { simple1 $  Tk__qq_CompilationUnit . ((tail . dropWhile (/= ':'))) }
          ("$"  "ImportList"  ":"  [a-zA-Z_]  [A-Za-z0-9_]*) { simple1 $  Tk__qq_ImportList . ((tail . dropWhile (/= ':'))) }
          ("$"  "TypeDeclarationList"  ":"  [a-zA-Z_]  [A-Za-z0-9_]*) { simple1 $  Tk__qq_TypeDeclarationList . ((tail . dropWhile (/= ':'))) }
          ("$"  "TypeDeclaration"  ":"  [a-zA-Z_]  [A-Za-z0-9_]*) { simple1 $  Tk__qq_TypeDeclaration . ((tail . dropWhile (/= ':'))) }
          ("$"  "OptDocComment"  ":"  [a-zA-Z_]  [A-Za-z0-9_]*) { simple1 $  Tk__qq_OptDocComment . ((tail . dropWhile (/= ':'))) }
          ("$"  "Java"  ":"  [a-zA-Z_]  [A-Za-z0-9_]*) { simple1 $  Tk__qq_Java . ((tail . dropWhile (/= ':'))) }
          . { rtkError }

{
data Token = EndOfFile |
             Tk__tok_AdditiveOp_dummy_205 |
             Tk__tok_Annotation_dummy_204 |
             Tk__tok_AnnotationArguments_dummy_203 |
             Tk__tok_AnnotationDeclaration_dummy_202 |
             Tk__tok_AnnotationElement_dummy_201 |
             Tk__tok_AnnotationList_dummy_200 |
             Tk__tok_AnnotationTypeElement_dummy_199 |
             Tk__tok_AnnotationTypeElementList_dummy_198 |
             Tk__tok_Arglist_dummy_197 |
             Tk__tok_ArrayInitializer_dummy_196 |
             Tk__tok_AssignmentOp_dummy_195 |
             Tk__tok_CatchList_dummy_194 |
             Tk__tok_CatchParameter_dummy_193 |
             Tk__tok_ClassDeclaration_dummy_192 |
             Tk__tok_ClassOrInterfaceType_dummy_191 |
             Tk__tok_CompilationUnit_dummy_190 |
             Tk__tok_CompilationUnitRest_dummy_189 |
             Tk__tok_CompoundName_dummy_188 |
             Tk__tok_CompoundNameTail_dummy_187 |
             Tk__tok_CreationExpression_dummy_186 |
             Tk__tok_DimExprs_dummy_185 |
             Tk__tok_Dims_dummy_184 |
             Tk__tok_DoStatement_dummy_183 |
             Tk__tok_DocComment_dummy_182 |
             Tk__tok_ElementValue_dummy_181 |
             Tk__tok_ElementValueArrayInitializer_dummy_180 |
             Tk__tok_EnumConstant_dummy_179 |
             Tk__tok_EnumConstantList_dummy_178 |
             Tk__tok_EnumDeclaration_dummy_177 |
             Tk__tok_EqualityOp_dummy_176 |
             Tk__tok_Expression_dummy_175 |
             Tk__tok_ExtendsList_dummy_174 |
             Tk__tok_FieldDeclaration_dummy_173 |
             Tk__tok_FieldDeclarationList_dummy_172 |
             Tk__tok_ForEachHeader_dummy_171 |
             Tk__tok_ForStatement_dummy_170 |
             Tk__tok_IfStatement_dummy_169 |
             Tk__tok_ImplementsList_dummy_168 |
             Tk__tok_ImportHead_dummy_167 |
             Tk__tok_ImportList_dummy_166 |
             Tk__tok_ImportName_dummy_165 |
             Tk__tok_ImportStatement_dummy_164 |
             Tk__tok_InterfaceDeclaration_dummy_163 |
             Tk__tok_Java_dummy_206 |
             Tk__tok_LambdaBody_dummy_162 |
             Tk__tok_Literal_dummy_161 |
             Tk__tok_LocalModifierList1_dummy_160 |
             Tk__tok_MemberAfterFirstId_dummy_159 |
             Tk__tok_MemberDeclaration_dummy_158 |
             Tk__tok_MemberRest_dummy_157 |
             Tk__tok_Modifier_dummy_156 |
             Tk__tok_ModifierList_dummy_155 |
             Tk__tok_MoreTypeSpecifier_dummy_154 |
             Tk__tok_MoreVariableDeclarators_dummy_153 |
             Tk__tok_MultiplicativeOp_dummy_152 |
             Tk__tok_NonEmptyDims_dummy_151 |
             Tk__tok_NonEmptyTypeArguments_dummy_150 |
             Tk__tok_NonEmptyTypeParameters_dummy_149 |
             Tk__tok_OptDocComment_dummy_148 |
             Tk__tok_OptElsePart_dummy_147 |
             Tk__tok_OptExpression_dummy_146 |
             Tk__tok_OptFinally_dummy_145 |
             Tk__tok_OptId_dummy_144 |
             Tk__tok_OptVariableInitializer_dummy_143 |
             Tk__tok_Package_dummy_142 |
             Tk__tok_ParamModifierList_dummy_141 |
             Tk__tok_Parameter_dummy_140 |
             Tk__tok_ParameterList_dummy_139 |
             Tk__tok_PostfixOp_dummy_138 |
             Tk__tok_PrefixOp_dummy_137 |
             Tk__tok_PrimitiveTypeKeyword_dummy_136 |
             Tk__tok_RelationalOp_dummy_135 |
             Tk__tok_Resource_dummy_134 |
             Tk__tok_ResourceSpec_dummy_133 |
             Tk__tok_ShiftOp_dummy_132 |
             Tk__tok_Statement_dummy_131 |
             Tk__tok_StatementBlock_dummy_130 |
             Tk__tok_StatementList_dummy_129 |
             Tk__tok_StaticInitializer_dummy_128 |
             Tk__tok_SwitchCaseList_dummy_127 |
             Tk__tok_SwitchStatement_dummy_126 |
             Tk__tok_ThrowsClause_dummy_125 |
             Tk__tok_TryStatement_dummy_124 |
             Tk__tok_Type_dummy_123 |
             Tk__tok_TypeArgument_dummy_122 |
             Tk__tok_TypeArguments_dummy_121 |
             Tk__tok_TypeDeclRest_dummy_120 |
             Tk__tok_TypeDeclaration_dummy_119 |
             Tk__tok_TypeDeclarationList_dummy_118 |
             Tk__tok_TypeParameter_dummy_117 |
             Tk__tok_TypeParameters_dummy_116 |
             Tk__tok_TypeSpecifier_dummy_115 |
             Tk__tok_VariableDeclaration_dummy_114 |
             Tk__tok_VariableDeclarator_dummy_113 |
             Tk__tok_VariableDeclaratorList_dummy_112 |
             Tk__tok_VariableInitializer_dummy_111 |
             Tk__tok_VariableInitializerList_dummy_110 |
             Tk__tok_WhileStatement_dummy_109 |
             Tk__tok_WildcardType_dummy_108 |
             Tk__tok__tilde__84 |
             Tk__tok__symbol__12 |
             Tk__tok__pipe__pipe__66 |
             Tk__tok__pipe__eql__58 |
             Tk__tok__pipe__48 |
             Tk__tok__symbol__11 |
             Tk__tok_while_45 |
             Tk__tok_void_28 |
             Tk__tok_try_50 |
             Tk__tok_true_88 |
             Tk__tok_transient_97 |
             Tk__tok_throws_29 |
             Tk__tok_throw_35 |
             Tk__tok_threadsafe_96 |
             Tk__tok_this_41 |
             Tk__tok_synchronized_34 |
             Tk__tok_switch_52 |
             Tk__tok_super_40 |
             Tk__tok_static_3 |
             Tk__tok_short_23 |
             Tk__tok_return_33 |
             Tk__tok_public_91 |
             Tk__tok_protected_93 |
             Tk__tok_private_92 |
             Tk__tok_package_0 |
             Tk__tok_null_90 |
             Tk__tok_new_87 |
             Tk__tok_native_94 |
             Tk__tok_long_26 |
             Tk__tok_interface_16 |
             Tk__tok_int_24 |
             Tk__tok_instanceof_76 |
             Tk__tok_import_2 |
             Tk__tok_implements_14 |
             Tk__tok_if_43 |
             Tk__tok_for_46 |
             Tk__tok_float_25 |
             Tk__tok_finally_49 |
             Tk__tok_final_31 |
             Tk__tok_false_89 |
             Tk__tok_extends_13 |
             Tk__tok_enum_17 |
             Tk__tok_else_42 |
             Tk__tok_double_27 |
             Tk__tok_do_44 |
             Tk__tok_default_30 |
             Tk__tok_continue_39 |
             Tk__tok_class_15 |
             Tk__tok_char_22 |
             Tk__tok_catch_47 |
             Tk__tok_case_51 |
             Tk__tok_byte_21 |
             Tk__tok_break_38 |
             Tk__tok_boolean_20 |
             Tk__tok_assert_36 |
             Tk__tok_abstract_95 |
             Tk__tok__symbol__eql__60 |
             Tk__tok__symbol__68 |
             Tk__tok__sq_bkt_r__19 |
             Tk__tok__sq_bkt_l__18 |
             Tk__tok__symbol__6 |
             Tk__tok__symbol__65 |
             Tk__tok__symbol__symbol__symbol__eql__64 |
             Tk__tok__symbol__symbol__eql__63 |
             Tk__tok__symbol__eql__75 |
             Tk__tok__symbol__73 |
             Tk__tok__eql__eql__70 |
             Tk__tok__eql__10 |
             Tk__tok__symbol__eql__74 |
             Tk__tok__symbol__symbol__eql__62 |
             Tk__tok__symbol__symbol__77 |
             Tk__tok__symbol__72 |
             Tk__tok__semi__1 |
             Tk__tok__colon__colon__86 |
             Tk__tok__colon__37 |
             Tk__tok__symbol__eql__57 |
             Tk__tok__symbol__80 |
             Tk__tok__dot__dot__dot__32 |
             Tk__tok__dot__4 |
             Tk__tok__minus__symbol__53 |
             Tk__tok__minus__eql__55 |
             Tk__tok__minus__minus__83 |
             Tk__tok__minus__79 |
             Tk__tok__coma__9 |
             Tk__tok__plus__eql__54 |
             Tk__tok__plus__plus__82 |
             Tk__tok__plus__78 |
             Tk__tok__star__eql__56 |
             Tk__tok__star__5 |
             Tk__tok__rparen__8 |
             Tk__tok__lparen__7 |
             Tk__tok__symbol__eql__59 |
             Tk__tok__symbol__symbol__67 |
             Tk__tok__symbol__69 |
             Tk__tok__symbol__eql__61 |
             Tk__tok__symbol__81 |
             Tk__tok__exclamation__eql__71 |
             Tk__tok__exclamation__85 |
             Tk__doccomment String |
             Tk__id String |
             Tk__string String |
             Tk__char String |
             Tk__floatTypeSuffix String |
             Tk__exponentPart String |
             Tk__floatLiteral String |
             Tk__integerLiteral String |
             Tk__qq_CompoundName String |
             Tk__qq_CompoundNameTail String |
             Tk__qq_Modifier String |
             Tk__qq_TypeSpecifier String |
             Tk__qq_Type String |
             Tk__qq_TypeParameter String |
             Tk__qq_NonEmptyTypeParameters String |
             Tk__qq_TypeParameters String |
             Tk__qq_WildcardType String |
             Tk__qq_TypeArgument String |
             Tk__qq_NonEmptyTypeArguments String |
             Tk__qq_TypeArguments String |
             Tk__qq_Arglist String |
             Tk__qq_Literal String |
             Tk__qq_DimExprs String |
             Tk__qq_CreationExpression String |
             Tk__qq_PostfixOp String |
             Tk__qq_PrefixOp String |
             Tk__qq_MultiplicativeOp String |
             Tk__qq_AdditiveOp String |
             Tk__qq_ShiftOp String |
             Tk__qq_RelationalOp String |
             Tk__qq_EqualityOp String |
             Tk__qq_AssignmentOp String |
             Tk__qq_LambdaBody String |
             Tk__qq_Expression String |
             Tk__qq_SwitchStatement String |
             Tk__qq_SwitchCaseList String |
             Tk__qq_Resource String |
             Tk__qq_ResourceSpec String |
             Tk__qq_TryStatement String |
             Tk__qq_OptFinally String |
             Tk__qq_CatchParameter String |
             Tk__qq_CatchList String |
             Tk__qq_ForEachHeader String |
             Tk__qq_ForStatement String |
             Tk__qq_WhileStatement String |
             Tk__qq_DoStatement String |
             Tk__qq_IfStatement String |
             Tk__qq_OptElsePart String |
             Tk__qq_Statement String |
             Tk__qq_OptId String |
             Tk__qq_OptExpression String |
             Tk__qq_StatementList String |
             Tk__qq_Parameter String |
             Tk__qq_ParamModifierList String |
             Tk__qq_ParameterList String |
             Tk__qq_StaticInitializer String |
             Tk__qq_ArrayInitializer String |
             Tk__qq_VariableInitializer String |
             Tk__qq_VariableInitializerList String |
             Tk__qq_VariableDeclarator String |
             Tk__qq_OptVariableInitializer String |
             Tk__qq_LocalModifierList1 String |
             Tk__qq_VariableDeclaration String |
             Tk__qq_VariableDeclaratorList String |
             Tk__qq_StatementBlock String |
             Tk__qq_MoreVariableDeclarators String |
             Tk__qq_MemberRest String |
             Tk__qq_ThrowsClause String |
             Tk__qq_MoreTypeSpecifier String |
             Tk__qq_MemberAfterFirstId String |
             Tk__qq_PrimitiveTypeKeyword String |
             Tk__qq_MemberDeclaration String |
             Tk__qq_NonEmptyDims String |
             Tk__qq_Dims String |
             Tk__qq_FieldDeclaration String |
             Tk__qq_TypeDeclRest String |
             Tk__qq_EnumDeclaration String |
             Tk__qq_EnumConstantList String |
             Tk__qq_EnumConstant String |
             Tk__qq_AnnotationTypeElement String |
             Tk__qq_AnnotationTypeElementList String |
             Tk__qq_AnnotationDeclaration String |
             Tk__qq_InterfaceDeclaration String |
             Tk__qq_ClassDeclaration String |
             Tk__qq_FieldDeclarationList String |
             Tk__qq_ImplementsList String |
             Tk__qq_ExtendsList String |
             Tk__qq_ClassOrInterfaceType String |
             Tk__qq_ModifierList String |
             Tk__qq_AnnotationList String |
             Tk__qq_ElementValueArrayInitializer String |
             Tk__qq_ElementValue String |
             Tk__qq_AnnotationElement String |
             Tk__qq_AnnotationArguments String |
             Tk__qq_Annotation String |
             Tk__qq_DocComment String |
             Tk__qq_ImportHead String |
             Tk__qq_ImportName String |
             Tk__qq_ImportStatement String |
             Tk__qq_Package String |
             Tk__qq_CompilationUnitRest String |
             Tk__qq_CompilationUnit String |
             Tk__qq_ImportList String |
             Tk__qq_TypeDeclarationList String |
             Tk__qq_TypeDeclaration String |
             Tk__qq_OptDocComment String |
             Tk__qq_Java String
             deriving (Show)

-- AlexPosn is defined by the alex wrapper, so the Data instance (required by
-- the parser's RtkPos position type) can only be attached via standalone
-- deriving - the same solution as the hand-written Lexer.x
deriving instance Data AlexPosn

-- A token together with the source position where it starts
data PosToken = PosToken { ptPos :: AlexPosn, ptToken :: Token }
                deriving (Show)

alexEOF = do
  (pos, _, _, _) <- alexGetInput
  return $ PosToken pos EndOfFile

-- Lex the input into a token stream, returning the positioned error message
-- on a lexical error (encoded as "LINE:COL:message", see rtkError below).
-- The returned list always ends with an EndOfFile token that carries the
-- position of the end of input, so parse errors at end of input can be
-- reported with a position too
scanTokens :: String -> Either String [PosToken]
scanTokens str = runAlex str $ do
  let loop toks = do tok <- alexMonadScan
                     case tok of
                       PosToken _ EndOfFile -> return $ reverse (tok : toks)
                       _ -> let toks' = tok : toks
                            in toks' `seq` loop toks'
  loop []

-- Thin compatibility wrapper: callers that have not switched to 'scanTokens'
-- get the error message thrown instead
alexScanTokens :: String -> [PosToken]
alexScanTokens str =
               case scanTokens str of
                  Right toks -> toks
                  Left err -> errorWithoutStackTrace err

simple1 :: (String -> Token) -> AlexInput -> Int -> Alex PosToken
simple1 t (pos, _, _, str) len = return $ PosToken pos (t (take len str))

simple :: Token -> AlexInput -> Int -> Alex PosToken
simple t (pos, _, _, _) len = return $ PosToken pos t

-- Encode the position as "LINE:COL:message" so callers can split it back out
-- into a structured position - the same encoding the rtk grammar lexer uses
rtkError ((AlexPn _ line column), _, _, str) len = alexError $ (show line) ++ ":" ++ (show column) ++ ":lexical error. Following chars: " ++ (take 10 str)

}