Package ch.usi.si.seart.treesitter
Enum Language
- java.lang.Object
-
- java.lang.Enum<Language>
-
- ch.usi.si.seart.treesitter.Language
-
- All Implemented Interfaces:
Serializable,Comparable<Language>
public enum Language extends Enum<Language>
Enum that consists of all the officially recognized programming languages.In terms of ABI, these include only languages with a version of either 13 or 14. The version of the underlying parser we use requires as a bare minimum the former. For this reason, languages that have not been maintained for a significant amount of time will not be supported by the library.
- Since:
- 1.0.0
- Author:
- Ozren Dabić
- See Also:
- tree-sitter language list
-
-
Enum Constant Summary
Enum Constants Enum Constant Description _INVALID_Represents an invalid language.ADAAda programming language.BASHBash: Bourne Again SHell.CC programming language.CLOJUREClojure programming language.CMAKEThe CMake language.COMMON_LISPCommon Lisp programming language.CPPC++ programming language.CSHARPC# programming language.CSSCSS: Cascading Style Sheets.DARTDart programming language.DOTDOT graph description language.ELIXIRElixir programming language.ELMElm programming language.EMBEDDED_TEMPLATEEmbedded HTML templates: EJS & ERS.ERLANGErlang programming language.FORTRANFortran programming language.GOGo programming language.GRAPHQLGraphQL: Graph Query Language.HASKELLHaskell programming language.HTMLHTML: HyperText Markup Language.JAVAJava programming language.JAVASCRIPTJavaScript programming language.JSONJSON: JavaScript Object Notation.JULIAJulia programming language.KOTLINKotlin programming language.LATEXLaTeX markup language for document typesetting.LUALua programming language.MARKDOWNMarkdown markup language for creating formatted text.NIXNix programming language.OBJECTIVE_CObjective-C programming language.OCAMLOCaml programming language.PASCALPascal programming language.PHPPHP: Hypertext Preprocessor.PYTHONPython programming language.RR programming language.RACKETRacket programming language.RUBYRuby programming language.RUSTRust programming language.SCALAScala programming language.SCHEMEScheme programming language.SCSSSCSS: Sassy CSS.SVELTESvelte front-end component framework.SWIFTSwift programming language.TOMLTOML: Tom's Obvious Minimal Language.TSXJSX-enhanced TypeScript.TYPESCRIPTTypeScript programming language.YAMLYAML: YAML Ain't Markup Language.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static @NotNull Collection<Language>associatedWith(@NotNull Path path)Selects enum values potentially associated with a file at a given path.intgetTotalSymbols()StringtoString()static voidvalidate(@NotNull Language language)Validates an enum value to ensure it is not null and has a valid (nonzero) identifier.static LanguagevalueOf(String name)Returns the enum constant of this type with the specified name.static Language[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
_INVALID_
@TestOnly public static final Language _INVALID_
Represents an invalid language. Used primarily for testing.
-
ADA
public static final Language ADA
Ada programming language.- See Also:
- tree-sitter-ada
-
BASH
public static final Language BASH
Bash: Bourne Again SHell.- See Also:
- tree-sitter-bash
-
C
public static final Language C
C programming language.- See Also:
- tree-sitter-c
-
CLOJURE
public static final Language CLOJURE
Clojure programming language.- See Also:
- tree-sitter-clojure
-
CMAKE
public static final Language CMAKE
The CMake language.- See Also:
- tree-sitter-cmake
-
COMMON_LISP
public static final Language COMMON_LISP
Common Lisp programming language.- See Also:
- tree-sitter-commonlisp
-
CSHARP
public static final Language CSHARP
C# programming language.- See Also:
- tree-sitter-c-sharp
-
CPP
public static final Language CPP
C++ programming language.- See Also:
- tree-sitter-cpp
-
CSS
public static final Language CSS
CSS: Cascading Style Sheets.- See Also:
- tree-sitter-css
-
DART
public static final Language DART
Dart programming language.- See Also:
- tree-sitter-dart
-
DOT
public static final Language DOT
DOT graph description language.- See Also:
- tree-sitter-dot
-
ELIXIR
public static final Language ELIXIR
Elixir programming language.- See Also:
- tree-sitter-elixir
-
ELM
public static final Language ELM
Elm programming language.- See Also:
- tree-sitter-elm
-
EMBEDDED_TEMPLATE
public static final Language EMBEDDED_TEMPLATE
Embedded HTML templates: EJS & ERS.- See Also:
- tree-sitter-embedded-template
-
ERLANG
public static final Language ERLANG
Erlang programming language.- See Also:
- tree-sitter-erlang
-
FORTRAN
public static final Language FORTRAN
Fortran programming language.- See Also:
- tree-sitter-fortran
-
GO
public static final Language GO
Go programming language.- See Also:
- tree-sitter-go
-
GRAPHQL
public static final Language GRAPHQL
GraphQL: Graph Query Language.- See Also:
- tree-sitter-graphql
-
HASKELL
public static final Language HASKELL
Haskell programming language.- See Also:
- tree-sitter-haskell
-
HTML
public static final Language HTML
HTML: HyperText Markup Language.- See Also:
- tree-sitter-html
-
JAVA
public static final Language JAVA
Java programming language.- See Also:
- tree-sitter-java
-
JAVASCRIPT
public static final Language JAVASCRIPT
JavaScript programming language.- See Also:
- tree-sitter-javascript
-
JSON
public static final Language JSON
JSON: JavaScript Object Notation.- See Also:
- tree-sitter-json
-
JULIA
public static final Language JULIA
Julia programming language.- See Also:
- tree-sitter-julia
-
KOTLIN
public static final Language KOTLIN
Kotlin programming language.- See Also:
- tree-sitter-kotlin
-
LATEX
public static final Language LATEX
LaTeX markup language for document typesetting.- See Also:
- tree-sitter-latex
-
LUA
public static final Language LUA
Lua programming language.- See Also:
- tree-sitter-lua
-
MARKDOWN
public static final Language MARKDOWN
Markdown markup language for creating formatted text.- See Also:
- tree-sitter-markdown
-
NIX
public static final Language NIX
Nix programming language.- See Also:
- tree-sitter-nix
-
OBJECTIVE_C
public static final Language OBJECTIVE_C
Objective-C programming language.- See Also:
- tree-sitter-objc
-
OCAML
public static final Language OCAML
OCaml programming language.- See Also:
- tree-sitter-ocaml
-
PASCAL
public static final Language PASCAL
Pascal programming language.- See Also:
- tree-sitter-pascal
-
PHP
public static final Language PHP
PHP: Hypertext Preprocessor.- See Also:
- tree-sitter-php
-
PYTHON
public static final Language PYTHON
Python programming language.- See Also:
- tree-sitter-python
-
R
public static final Language R
R programming language.- See Also:
- tree-sitter-r
-
RACKET
public static final Language RACKET
Racket programming language.- See Also:
- tree-sitter-racket
-
RUBY
public static final Language RUBY
Ruby programming language.- See Also:
- tree-sitter-ruby
-
RUST
public static final Language RUST
Rust programming language.- See Also:
- tree-sitter-rust
-
SCALA
public static final Language SCALA
Scala programming language.- See Also:
- tree-sitter-scala
-
SCHEME
public static final Language SCHEME
Scheme programming language.- See Also:
- tree-sitter-scheme
-
SCSS
public static final Language SCSS
SCSS: Sassy CSS.- See Also:
- tree-sitter-scss
-
SVELTE
public static final Language SVELTE
Svelte front-end component framework.- See Also:
- tree-sitter-svelte
-
SWIFT
public static final Language SWIFT
Swift programming language.- See Also:
- tree-sitter-swift
-
TOML
public static final Language TOML
TOML: Tom's Obvious Minimal Language.- See Also:
- tree-sitter-toml
-
TSX
public static final Language TSX
JSX-enhanced TypeScript.- See Also:
- tree-sitter-typescript
-
TYPESCRIPT
public static final Language TYPESCRIPT
TypeScript programming language.- See Also:
- tree-sitter-typescript
-
YAML
public static final Language YAML
YAML: YAML Ain't Markup Language.- See Also:
- tree-sitter-yaml
-
-
Method Detail
-
values
public static Language[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (Language c : Language.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static Language valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum type has no constant with the specified nameNullPointerException- if the argument is null
-
validate
public static void validate(@NotNull @NotNull Language language)Validates an enum value to ensure it is not null and has a valid (nonzero) identifier.- Parameters:
language- the instance to validate- Throws:
NullPointerException- if the language is nullUnsatisfiedLinkError- if the language was not linked to native codeABIVersionError- if the language ABI version is outdated
-
associatedWith
@NotNull public static @NotNull Collection<Language> associatedWith(@NotNull @NotNull Path path)
Selects enum values potentially associated with a file at a given path. This method checks the file's extension or name to determine the candidate language(s). Returns an empty collection if no associations can be made to a file.- Parameters:
path- location of the file whose language associations we want to determine- Returns:
- An immutable collection of languages associated with the file (never null)
- Throws:
NullPointerException- ifpathis nullIllegalArgumentException- ifpathis a directory- Since:
- 1.6.0
-
getTotalSymbols
public int getTotalSymbols()
-
-