001/*-------------------------------------------------------------------------+ 002| | 003| Copyright (c) 2009-2018 CQSE GmbH | 004| | 005+-------------------------------------------------------------------------*/ 006package eu.cqse.check.framework.shallowparser.languages.kotlin; 007 008/** Parser states for the Kotlin parser. */ 009public enum EKotlinParserStates { 010 011 /** Top level state. */ 012 TOP_LEVEL, 013 014 /** Currently within module definition (or package, namespace, etc.). */ 015 IN_MODULE, 016 017 /** Currently within type definition (class, etc.). */ 018 IN_TYPE, 019 020 /** Currently within method/procedure/function definition. */ 021 IN_METHOD, 022 023 /** 024 * Currently within an expression. Typically, we expect anonymous classes, 025 * lambdas, etc. in this state. 026 */ 027 IN_LAMBDA, 028 029 /** 030 * Currently within a when (switch in Java) statement. 031 */ 032 IN_WHEN, 033 034 /** 035 * Currently within a statement and found IF or WHEN expression. 036 */ 037 IN_STATEMENT, 038 039 /** 040 * Currently within the scope of a property, where get and set methods may be 041 * defined. 042 */ 043 IN_PROPERTY, 044 045 /** 046 * Currently within the scope of an enum class in the stage where enum literals 047 * are defined. 048 */ 049 IN_ENUM; 050}