Skip to content

rickbusarow/statik

Repository files navigation

Maven Central Sonatype Nexus (Snapshots) License

Important

Moving soonish to https://github.com/square/statik.

Statik is a high-level Abstract Syntax Tree or Abstract Semantic Graph with three goals:

  1. Provide high-level information as members directly in node elements, so that most parsing can be done intuitively using semantics.

    interface StatikKotlinFunction<out PARENT> : StatikFunction<PARENT> /* ... */ {
    
      // semantic information about the function
      override val annotations: LazySet<StatikAnnotation<*>>
      override val visibility: StatikKotlinVisibility
      override val typeParameters: LazySet<StatikKotlinTypeParameter<*>>
      override val valueParameters: LazySet<StatikKotlinValueParameter<*>>
      override val returnType: LazyDeferred<ReferenceName>
    
      // syntactic information about the function
      override val modifierList: ModifierList
      override val typeParameterList: TypeParameterList?
      override val valueParameterList: ValueParameterList?
      // ...
    
      // standard AST features
      override val text: String
      override val containingFile: StatikKotlinFile
      override val parent: PARENT
      override val children: LazySet<StatikElement>
      override val node: KtFunction
    }
  2. Make Statik's published artifacts work with multiple versions of the Kotlin compiler, so that a Statik update does not require a simultaneous Kotlin update. This is accomplished using Gradle's Feature Variants, so that Gradle automatically selects the right Statik .jar based upon the Kotlin version in use.

  3. Resolve non-Kotlin as well, including references to Java and Android resources generated from xml.

License

Copyright (C) 2023 Rick Busarow
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
     https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •