1
1
mirror of https://github.com/github/semantic.git synced 2024-12-29 01:42:43 +03:00

add Java grammar

This commit is contained in:
Ayman Nadeem 2020-01-29 15:51:09 -05:00
parent 699f8c343b
commit f2d3b14032
3 changed files with 18 additions and 3 deletions

View File

@ -1,14 +1,14 @@
-- | Semantic functionality for Java programs.
module Language.Java
( Term(..)
, TreeSitter.Java.tree_sitter_java
, Language.Java.Grammar.tree_sitter_java
) where
import Data.Proxy
import qualified Language.Java.AST as Java
import qualified Language.Java.Tags as JavaTags
import qualified Tags.Tagging.Precise as Tags
import qualified TreeSitter.Java (tree_sitter_java)
import qualified Language.Java.Grammar (tree_sitter_java)
import qualified AST.Unmarshal as TS
newtype Term a = Term { getTerm :: Java.Program a }

View File

@ -15,7 +15,7 @@ module Language.Java.AST
) where
import AST.GenerateSyntax
import qualified TreeSitter.Java as Grammar
import qualified Language.Java.Grammar as Grammar
import AST.Token
astDeclarationsForLanguage Grammar.tree_sitter_java "../../../vendor/tree-sitter-java/src/node-types.json"

View File

@ -0,0 +1,15 @@
{-# LANGUAGE TemplateHaskell #-}
module Language.Java.Grammar
( tree_sitter_java
, Grammar(..)
) where
import Language.Haskell.TH
import TreeSitter.Java.Internal
import TreeSitter.Language
-- Regenerate template haskell code when these files change:
addDependentFileRelative "../../../vendor/tree-sitter-java/src/parser.c"
-- | Statically-known rules corresponding to symbols in the grammar.
mkSymbolDatatype (mkName "Grammar") tree_sitter_java