Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 19 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ configure(subprojects.findAll {it.name != 'core'}) {
}
}

configure(subprojects.findAll { it.name.startsWith('gen.antlr') }) {
configure(subprojects.findAll { it.name == 'gen.antlr' || it.name.startsWith('gen.antlr-') }) {
apply plugin: 'antlr'

dependencies {
Expand All @@ -67,6 +67,24 @@ configure(subprojects.findAll { it.name.startsWith('gen.antlr') }) {
}
}

configure(subprojects.findAll { it.name == 'gen.antlr4' || it.name.startsWith('gen.antlr4-') }) {
apply plugin: 'antlr'

dependencies {
antlr "org.antlr:antlr4:4.5.3"
}

generateGrammarSource {
outputDirectory = new File("${project.buildDir}/generated-src/antlr/main/com/github/gumtreediff/gen/php71".toString())
}

if (it.name.startsWith('gen.antlr4-')) {
dependencies {
compile project(':gen.antlr4')
}
}
}

def jacocoProjectsNames = ['core', 'gen.jdt', 'gen.c', 'gen.ruby', 'gen.js', 'gen.srcml', 'gen.css']
def jacocoProjects = subprojects.findAll { it.name in jacocoProjectsNames}
configure(jacocoProjects) {
Expand Down
2 changes: 2 additions & 0 deletions dist/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ dependencies {
compile project(':gen.antlr-php')
compile project(':gen.antlr-r')
compile project(':gen.antlr-xml')
compile project(':gen.antlr4')
compile project(':gen.antlr4-php')
compile project(':gen.c')
compile project(':gen.css')
compile project(':gen.jdt')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

package com.github.gumtreediff.gen.php;

import com.github.gumtreediff.gen.Registry;
import com.github.gumtreediff.gen.antlr.AbstractAntlrTreeGenerator;
import com.github.gumtreediff.gen.Register;
import com.github.gumtreediff.gen.antlr.AbstractAntlrTreeGenerator;
Expand All @@ -29,7 +30,7 @@
import java.io.IOException;
import java.io.Reader;

@Register(id = "php-antlr", accept = "\\.php.?$")
@Register(id = "php-antlr", accept = "\\.php.?$", priority = Registry.Priority.LOW)
public class PhpTreeGenerator extends AbstractAntlrTreeGenerator {

@Override
Expand Down
1 change: 1 addition & 0 deletions gen.antlr4-php/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
description = 'GumTree tree generator for PHP7.1 code (AntLR4 based).'
Loading