JetFile: List.jet
  NAMESPACE
    CLASS
      MODIFIER_LIST
        PsiElement(enum)('enum')
      PsiWhiteSpace(' ')
      PsiElement(class)('class')
      PsiWhiteSpace(' ')
      PsiElement(IDENTIFIER)('List')
      TYPE_PARAMETER_LIST
        PsiElement(LT)('<')
        TYPE_PARAMETER
          MODIFIER_LIST
            PsiElement(out)('out')
          PsiWhiteSpace(' ')
          PsiElement(IDENTIFIER)('T')
        PsiElement(GT)('>')
      PRIMARY_CONSTRUCTOR_PARAMETERS_LIST
        PsiElement(LPAR)('(')
        PRIMARY_CONSTRUCTOR_PARAMETER
          PsiElement(IDENTIFIER)('theSize')
          PsiWhiteSpace(' ')
          PsiElement(COLON)(':')
          PsiWhiteSpace(' ')
          TYPE_REFERENCE
            USER_TYPE
              PsiElement(IDENTIFIER)('Int')
        PsiElement(RPAR)(')')
      PsiWhiteSpace(' ')
      PsiElement(COLON)(':')
      PsiWhiteSpace(' ')
      DELEGATION_SPECIFIER_LIST
        DELEGATOR_SUPER_CLASS
          TYPE_REFERENCE
            USER_TYPE
              PsiElement(IDENTIFIER)('IList')
              TYPE_ARGUMENT_LIST
                PsiElement(LT)('<')
                TYPE_REFERENCE
                  USER_TYPE
                    PsiElement(IDENTIFIER)('T')
                PsiElement(GT)('>')
      PsiWhiteSpace(' ')
      CLASS_BODY
        PsiElement(LBRACE)('{')
        PsiWhiteSpace('\n  ')
        ENUM_ENTRY
          PsiElement(IDENTIFIER)('Nil')
          PsiWhiteSpace(' ')
          TYPE_PARAMETER_LIST
            <empty list>
          PsiElement(COLON)(':')
          PsiWhiteSpace(' ')
          INITIALIZER_LIST
            DELEGATOR_SUPER_CALL
              TYPE_REFERENCE
                USER_TYPE
                  PsiElement(IDENTIFIER)('List')
                  TYPE_ARGUMENT_LIST
                    PsiElement(LT)('<')
                    TYPE_REFERENCE
                      USER_TYPE
                        PsiElement(IDENTIFIER)('Nothing')
                    PsiElement(GT)('>')
              VALUE_ARGUMENT_LIST
                PsiElement(LPAR)('(')
                VALUE_ARGUMENT
                  INTEGER_CONSTANT
                    PsiElement(INTEGER_LITERAL)('0')
                PsiElement(RPAR)(')')
        PsiWhiteSpace('\n\n  ')
        ENUM_ENTRY
          PsiElement(IDENTIFIER)('Cons')
          TYPE_PARAMETER_LIST
            PsiElement(LT)('<')
            TYPE_PARAMETER
              PsiElement(IDENTIFIER)('T')
            PsiElement(GT)('>')
          PRIMARY_CONSTRUCTOR_PARAMETERS_LIST
            PsiElement(LPAR)('(')
            PRIMARY_CONSTRUCTOR_PARAMETER
              PsiElement(val)('val')
              PsiWhiteSpace(' ')
              PsiElement(IDENTIFIER)('value')
              PsiWhiteSpace(' ')
              PsiElement(COLON)(':')
              PsiWhiteSpace(' ')
              TYPE_REFERENCE
                USER_TYPE
                  PsiElement(IDENTIFIER)('T')
            PsiElement(COMMA)(',')
            PsiWhiteSpace(' ')
            PRIMARY_CONSTRUCTOR_PARAMETER
              PsiElement(val)('val')
              PsiWhiteSpace(' ')
              PsiElement(IDENTIFIER)('tail')
              PsiWhiteSpace(' ')
              PsiElement(COLON)(':')
              PsiWhiteSpace(' ')
              TYPE_REFERENCE
                USER_TYPE
                  PsiElement(IDENTIFIER)('List')
                  TYPE_ARGUMENT_LIST
                    PsiElement(LT)('<')
                    TYPE_REFERENCE
                      USER_TYPE
                        PsiElement(IDENTIFIER)('T')
                    PsiElement(GT)('>')
            PsiElement(RPAR)(')')
          PsiWhiteSpace(' ')
          PsiElement(COLON)(':')
          PsiWhiteSpace(' ')
          INITIALIZER_LIST
            DELEGATOR_SUPER_CALL
              TYPE_REFERENCE
                USER_TYPE
                  PsiElement(IDENTIFIER)('List')
                  TYPE_ARGUMENT_LIST
                    PsiElement(LT)('<')
                    TYPE_REFERENCE
                      USER_TYPE
                        PsiElement(IDENTIFIER)('T')
                    PsiElement(GT)('>')
              VALUE_ARGUMENT_LIST
                PsiElement(LPAR)('(')
                VALUE_ARGUMENT
                  BINARY_EXPRESSION
                    INTEGER_CONSTANT
                      PsiElement(INTEGER_LITERAL)('1')
                    PsiWhiteSpace(' ')
                    PsiElement(PLUS)('+')
                    PsiWhiteSpace(' ')
                    DOT_QIALIFIED_EXPRESSION
                      REFERENCE_EXPRESSION
                        PsiElement(IDENTIFIER)('tail')
                      PsiElement(DOT)('.')
                      REFERENCE_EXPRESSION
                        PsiElement(IDENTIFIER)('size')
                PsiElement(RPAR)(')')
        PsiWhiteSpace('\n\n  ')
        PROPERTY
          MODIFIER_LIST
            PsiElement(override)('override')
          PsiWhiteSpace(' ')
          PsiElement(val)('val')
          PsiWhiteSpace(' ')
          PsiElement(IDENTIFIER)('size')
          PsiWhiteSpace(' ')
          PsiElement(COLON)(':')
          PsiWhiteSpace(' ')
          TYPE_REFERENCE
            USER_TYPE
              PsiElement(IDENTIFIER)('Int')
          PsiWhiteSpace('\n    ')
          PROPERTY_ACCESSOR
            PsiElement(get)('get')
            PsiElement(LPAR)('(')
            PsiElement(RPAR)(')')
            PsiWhiteSpace(' ')
            PsiElement(EQ)('=')
            PsiWhiteSpace(' ')
            REFERENCE_EXPRESSION
              PsiElement(IDENTIFIER)('theSize')
        PsiWhiteSpace('\n\n\n  ')
        PROPERTY
          MODIFIER_LIST
            PsiElement(override)('override')
          PsiWhiteSpace(' ')
          PsiElement(val)('val')
          PsiWhiteSpace(' ')
          PsiElement(IDENTIFIER)('isEmpty')
          PsiWhiteSpace(' ')
          PsiElement(COLON)(':')
          PsiWhiteSpace(' ')
          TYPE_REFERENCE
            USER_TYPE
              PsiElement(IDENTIFIER)('Boolean')
          PsiWhiteSpace('\n    ')
          PROPERTY_ACCESSOR
            PsiElement(get)('get')
            PsiElement(LPAR)('(')
            PsiElement(RPAR)(')')
            PsiWhiteSpace(' ')
            PsiElement(EQ)('=')
            PsiWhiteSpace(' ')
            BINARY_EXPRESSION
              THIS_EXPRESSION
                PsiElement(this)('this')
              PsiWhiteSpace(' ')
              PsiElement(EQEQ)('==')
              PsiWhiteSpace(' ')
              REFERENCE_EXPRESSION
                PsiElement(IDENTIFIER)('Nil')
        PsiWhiteSpace('\n\n\n  ')
        FUN
          MODIFIER_LIST
            PsiElement(override)('override')
          PsiWhiteSpace(' ')
          PsiElement(fun)('fun')
          PsiWhiteSpace(' ')
          PsiElement(IDENTIFIER)('iterator')
          TYPE_PARAMETER_LIST
            <empty list>
          VALUE_PARAMETER_LIST
            PsiElement(LPAR)('(')
            PsiElement(RPAR)(')')
          PsiWhiteSpace(' ')
          PsiElement(EQ)('=')
          PsiWhiteSpace(' ')
          CALL_EXPRESSION
            NEW
              PsiElement(new)('new')
              PsiWhiteSpace(' ')
              TYPE_REFERENCE
                USER_TYPE
                  PsiElement(IDENTIFIER)('IIterator')
              VALUE_ARGUMENT_LIST
                PsiElement(LPAR)('(')
                PsiElement(RPAR)(')')
            PsiWhiteSpace(' ')
            FUNCTION_LITERAL
              PsiElement(LBRACE)('{')
              PsiWhiteSpace('\n    ')
              BODY
                PROPERTY
                  MODIFIER_LIST
                    PsiElement(private)('private')
                  PsiWhiteSpace(' ')
                  PsiElement(var)('var')
                  PsiWhiteSpace(' ')
                  PsiElement(IDENTIFIER)('current')
                  PsiWhiteSpace(' ')
                  PsiElement(EQ)('=')
                  PsiWhiteSpace(' ')
                  DOT_QIALIFIED_EXPRESSION
                    REFERENCE_EXPRESSION
                      PsiElement(IDENTIFIER)('List')
                    PsiElement(DOT)('.')
                    THIS_EXPRESSION
                      PsiElement(this)('this')
                PsiWhiteSpace('\n\n    ')
                CALL_EXPRESSION
                  PROPERTY
                    MODIFIER_LIST
                      PsiElement(override)('override')
                    PsiWhiteSpace(' ')
                    PsiElement(val)('val')
                    PsiWhiteSpace(' ')
                    PsiElement(IDENTIFIER)('hasNext')
                  PsiWhiteSpace(' ')
                  FUNCTION_LITERAL
                    PsiElement(LBRACE)('{')
                    PsiWhiteSpace('\n      ')
                    BODY
                      BINARY_EXPRESSION
                        CALL_EXPRESSION
                          REFERENCE_EXPRESSION
                            PsiElement(IDENTIFIER)('get')
                          VALUE_ARGUMENT_LIST
                            PsiElement(LPAR)('(')
                            PsiElement(RPAR)(')')
                        PsiWhiteSpace(' ')
                        PsiElement(EQ)('=')
                        PsiWhiteSpace(' ')
                        BINARY_EXPRESSION
                          REFERENCE_EXPRESSION
                            PsiElement(IDENTIFIER)('current')
                          PsiWhiteSpace(' ')
                          PsiElement(EQEQ)('==')
                          PsiWhiteSpace(' ')
                          REFERENCE_EXPRESSION
                            PsiElement(IDENTIFIER)('Nil')
                    PsiWhiteSpace('\n    ')
                    PsiElement(RBRACE)('}')
                PsiWhiteSpace('\n\n    ')
                FUN
                  MODIFIER_LIST
                    PsiElement(override)('override')
                  PsiWhiteSpace(' ')
                  PsiElement(fun)('fun')
                  PsiWhiteSpace(' ')
                  PsiElement(IDENTIFIER)('next')
                  TYPE_PARAMETER_LIST
                    <empty list>
                  VALUE_PARAMETER_LIST
                    PsiElement(LPAR)('(')
                    PsiElement(RPAR)(')')
                  PsiWhiteSpace(' ')
                  BLOCK
                    PsiElement(LBRACE)('{')
                    PsiWhiteSpace('\n      ')
                    PROPERTY
                      PsiElement(val)('val')
                      PsiWhiteSpace(' ')
                      PsiElement(IDENTIFIER)('result')
                      PsiWhiteSpace(' ')
                      PsiElement(EQ)('=')
                      PsiWhiteSpace(' ')
                      DOT_QIALIFIED_EXPRESSION
                        REFERENCE_EXPRESSION
                          PsiElement(IDENTIFIER)('current')
                        PsiElement(DOT)('.')
                        REFERENCE_EXPRESSION
                          PsiElement(IDENTIFIER)('value')
                    PsiWhiteSpace('\n      ')
                    BINARY_EXPRESSION
                      REFERENCE_EXPRESSION
                        PsiElement(IDENTIFIER)('current')
                      PsiWhiteSpace(' ')
                      PsiElement(EQ)('=')
                      PsiWhiteSpace(' ')
                      DOT_QIALIFIED_EXPRESSION
                        REFERENCE_EXPRESSION
                          PsiElement(IDENTIFIER)('current')
                        PsiElement(DOT)('.')
                        REFERENCE_EXPRESSION
                          PsiElement(IDENTIFIER)('tail')
                    PsiWhiteSpace('\n      ')
                    RETURN
                      PsiElement(return)('return')
                      PsiWhiteSpace(' ')
                      REFERENCE_EXPRESSION
                        PsiElement(IDENTIFIER)('result')
                    PsiWhiteSpace('\n    ')
                    PsiElement(RBRACE)('}')
              PsiWhiteSpace('\n  ')
              PsiElement(RBRACE)('}')
        PsiWhiteSpace('\n')
        PsiElement(RBRACE)('}')