Commit 95ffbb79 authored by Jonathan Shahen's avatar Jonathan Shahen
Browse files

Relocate the parser to the Global Repo

parent 51c85085
......@@ -16,9 +16,7 @@
<property name="dist" location="${bin}/dist" />
<property name="qtest" location="${data}/testcases" />
<property name="mohawksrc" location="${src}/mohawk" />
<property name="antlr-script" location="${mohawksrc}/rbac/generated" />
<property name="template" location="${mohawksrc}/output" />
<property name="rbac" location="${mohawksrc}/rbac/generated" />
<property name="antlr" location="${lib}/antlr-4.4-complete.jar" />
<property name="junit" location="${lib}/junit-4.12.jar" />
......@@ -44,25 +42,7 @@
<mkdir dir="${dist}" />
</target>
<target name="parser" depends="init" description="generate parser files">
<!-- Create the parser files -->
<!--
<antlr target="${rbac}/Mohawk.g4" outputdirectory="${rbac}">
<classpath>
<pathelement location="${antlr}" />
</classpath>
</antlr>
-->
<java jar="${antlr}" fork="true">
<arg value="-o" />
<arg value="${antlr-script}" />
<arg value="-package" />
<arg value="${parser-package}" />
<arg value="${antlr-script}/Mohawk.g4" />
</java>
</target>
<target name="compile" depends="parser" description="compile the source ">
<target name="compile" depends="init" description="compile the source ">
<!-- compile the java code from ${src} into ${build} -->
<javac srcdir="${src}" destdir="${build}" debug="on" deprecation="true">
<src path="${src}" />
......
......@@ -33,11 +33,11 @@ import java.util.*;
import org.antlr.v4.runtime.*;
import mohawk.global.parser.mohawk.v1.MohawkLexer;
import mohawk.global.parser.mohawk.v1.MohawkParser;
import mohawk.global.pieces.mohawk.CAEntry;
import mohawk.global.pieces.mohawk.CREntry;
import mohawk.output.WriteNuSMV;
import mohawk.rbac.generated.MohawkLexer;
import mohawk.rbac.generated.MohawkParser;
/**
* @author Karthick Jayaraman This is the main class that will serve as an entry point to the tool.
......@@ -95,7 +95,8 @@ public class RBAC2SMV {
try {
parser.init();
rbac = parser.getRBAC();
rbac = new RBACInstance(parser.vRoles, parser.vUsers, parser.vAdmin, parser.mUA, parser.mCR, parser.mCA,
parser.vSpec);
} catch (RecognitionException e) {
e.printStackTrace();
......
......@@ -9,8 +9,8 @@ import java.util.*;
import org.antlr.v4.runtime.*;
import org.stringtemplate.v4.ST;
import mohawk.rbac.generated.MohawkLexer;
import mohawk.rbac.generated.MohawkParser;
import mohawk.global.parser.mohawk.v1.MohawkLexer;
import mohawk.global.parser.mohawk.v1.MohawkParser;
import mohawk.global.pieces.mohawk.*;
/**
......@@ -60,7 +60,8 @@ public class RBACPAT {
try {
parser.init();
rbac = parser.getRBAC();
rbac = new RBACInstance(parser.vRoles, parser.vUsers, parser.vAdmin, parser.mUA, parser.mCR, parser.mCA,
parser.vSpec);
} catch (RecognitionException e) {
e.printStackTrace();
......
......@@ -8,8 +8,8 @@ import java.util.logging.Logger;
import org.antlr.v4.runtime.*;
import mohawk.rbac.generated.MohawkLexer;
import mohawk.rbac.generated.MohawkParser;
import mohawk.global.parser.mohawk.v1.MohawkLexer;
import mohawk.global.parser.mohawk.v1.MohawkParser;
/**
* @author Karthick Jayaraman
......@@ -35,7 +35,8 @@ public class RBACSpecReader {
try {
parser.init();
rbac = parser.getRBAC();
rbac = new RBACInstance(parser.vRoles, parser.vUsers, parser.vAdmin, parser.mUA, parser.mCR, parser.mCA,
parser.vSpec);
} catch (RecognitionException e) {
e.printStackTrace();
......@@ -60,7 +61,8 @@ public class RBACSpecReader {
parser.initRbac();
parser.init();
rbac = parser.getRBAC();
rbac = new RBACInstance(parser.vRoles, parser.vUsers, parser.vAdmin, parser.mUA, parser.mCR, parser.mCA,
parser.vSpec);
} catch (RecognitionException | IOException e) {
e.printStackTrace();
}
......
......@@ -8,10 +8,10 @@ import java.util.logging.Logger;
import org.antlr.v4.runtime.*;
import mohawk.global.parser.mohawk.v1.MohawkLexer;
import mohawk.global.parser.mohawk.v1.MohawkParser;
import mohawk.output.WriteRBACSpec;
import mohawk.rbac.RBACInstance;
import mohawk.rbac.generated.MohawkLexer;
import mohawk.rbac.generated.MohawkParser;
/**
* @author Karthick Jayaraman
......@@ -48,7 +48,8 @@ public class RemoveCR {
try {
parser.init();
rbac = parser.getRBAC();
rbac = new RBACInstance(parser.vRoles, parser.vUsers, parser.vAdmin, parser.mUA, parser.mCR, parser.mCA,
parser.vSpec);
} catch (RecognitionException e) {
e.printStackTrace();
......
......@@ -9,11 +9,11 @@ import java.util.logging.Logger;
import org.antlr.v4.runtime.*;
import mohawk.global.parser.mohawk.v1.MohawkLexer;
import mohawk.global.parser.mohawk.v1.MohawkParser;
import mohawk.global.pieces.mohawk.CAEntry;
import mohawk.global.pieces.mohawk.CREntry;
import mohawk.rbac.RBACInstance;
import mohawk.rbac.generated.MohawkLexer;
import mohawk.rbac.generated.MohawkParser;
/**
* @author Karthick Jayaraman
......@@ -47,7 +47,8 @@ public class SizeOfRBAC {
try {
parser.init();
rbac = parser.getRBAC();
rbac = new RBACInstance(parser.vRoles, parser.vUsers, parser.vAdmin, parser.mUA, parser.mCR, parser.mCA,
parser.vSpec);
} catch (RecognitionException e) {
e.printStackTrace();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment