Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
O
OwlCompiler
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Anders Nilsson
OwlCompiler
Commits
684e1497
Commit
684e1497
authored
18 years ago
by
Anders Nilsson
Browse files
Options
Downloads
Patches
Plain Diff
Maybe last, non-working, version of explicit JavaCC grammar
parent
24d5c10e
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
CompilerGeneration.jrag
+1
-1
1 addition, 1 deletion
CompilerGeneration.jrag
siaras/build.xml
+113
-0
113 additions, 0 deletions
siaras/build.xml
with
114 additions
and
1 deletion
CompilerGeneration.jrag
+
1
−
1
View file @
684e1497
...
...
@@ -159,7 +159,7 @@ aspect JavaCCGen {
Restrictions restr = getRestrictions();
for (int i=0; i< getNumRestriction(); i++) {
OwlRestriction res = restr.getOwlRestriction(i);
pStream.print("("+res.getRestrictionClassId()+")"+
pStream.print("("+res.getRestrictionClassId()+"
()
)"+
(res.allValuesFrom()?"*":"")+" ");
}
pStream.println(" #"+getId()+"("+getNumRestriction()+"))");
...
...
This diff is collapsed.
Click to expand it.
siaras/build.xml
0 → 100644
+
113
−
0
View file @
684e1497
<!--
Targets for working from terminal window:
build (default) - generates java files and compiles them
clean - removes all generated files and class files
Targets for working from Eclipse:
gen - generates java files
genClean - removes all generated files and their class files
-->
<project
name=
"Java1.4Frontend"
default=
"build"
basedir=
"."
>
<!-- "package" is the directory where generated files will be stored -->
<property
name=
"package"
value=
"AST"
/>
<!-- "tools" is the directory where generators and libraries are located. -->
<property
name=
"tools"
value=
"../tools"
/>
<property
name=
"javacc.home"
value=
"../tools/javacc-4.0"
/>
<property
name=
"parser.name"
value=
"SiarasParser"
/>
<!-- "jflex" is an ant task class for the scanner generator in JFlex.jar -->
<!-- <taskdef name="jflex" classname="JFlex.anttask.JFlexTask" classpath="tools/JFlex.jar"/> -->
<!-- "beaver" is an ant task class for the parser generator in beaver.jar -->
<!-- <taskdef name="beaver" classname="beaver.comp.run.AntTask" classpath="tools/beaver.jar"/> -->
<!-- "jastadd" is an ant task class in jastadd2.jar -->
<taskdef
name=
"jastadd"
classname=
"jastadd.JastAddTask"
classpath=
"../tools/jastadd2.jar"
/>
<!-- compile sources -->
<target
name=
"build"
depends=
"gen"
>
<javac
compiler=
"jikes"
debug=
"true"
nowarn=
"true"
srcdir=
"."
includes=
"**/*.java"
excludes=
"tools/** siaras/**"
classpath=
".:${tools}/beaver-rt.jar:${tools}/junit.jar"
/>
</target>
<!-- generate compiler source files -->
<target
name=
"gen"
description=
"Generate compiler source files"
>
<!-- create AST node types and weave aspect modules -->
<echo
message =
"Running JastAdd"
/>
<!-- <jastadd package="${package}" rewrite="true" beaver="true" novisitcheck="true"> -->
<jastadd
package=
"${package}"
grammar=
"${parser.name}"
rewrite=
"true"
jjtree=
"true"
>
<fileset
dir=
"."
>
<include
name=
"*.ast"
/>
<include
name=
"*.jrag"
/>
<include
name=
"*.jadd"
/>
</fileset>
</jastadd>
<jjtree
target=
"Siaras.jjt"
outputdirectory=
"${package}"
javacchome=
"${javacc.home}"
buildnodefiles=
"true"
static=
"false"
multi=
"true"
visitor=
"true"
nodedefaultvoid=
"true"
nodeprefix=
'""'
nodepackage=
"${package}"
/>
<javacc
target=
"${package}/Siaras.jj"
outputdirectory=
"${package}"
javacchome=
"${javacc.home}"
buildparser=
"true"
buildtokenmanager=
"true"
static=
"false"
/>
<!-- generate the scanner -->
<!-- <echo message = "Running jflex"/> -->
<!-- <jflex file="parser/java14.flex" outdir="parser" nobak="yes"/> -->
<!-- generate the scanner -->
<!-- <jflex file="parser/unicode.flex" outdir="parser" nobak="yes"/> -->
<!-- generate the parser phase 1, create a full .lalr specification from fragments-->
<!-- <echo message = "Running parser phase 1"/> -->
<!-- <concat destfile="parser/JavaParser.all" binary="true"> -->
<!-- <fileset dir="."> -->
<!-- <include name="parser/java14.parser"/> -->
<!-- </fileset> -->
<!-- </concat> -->
<!-- generate the parser phase 2, translating .lalr to .beaver -->
<!-- <java classpath="${tools}/proj.jar:${tools}/beaver-rt.jar" classname="Main"> -->
<!-- <arg line="parser/JavaParser.all parser/JavaParser.beaver"/> -->
<!-- </java> -->
<!-- generate the parser phase 3, translating .beaver to .java -->
<!-- <beaver file="parser/JavaParser.beaver" terminalNames="yes" compress="no" useSwitch="yes"/> -->
</target>
<target
name=
"test"
depends=
"build"
>
<java
classname=
"GenCompiler"
classpath=
"."
>
<arg
value=
"GripperOntology_experimental3.owl"
/>
</java>
</target>
<!-- remove generated source files and .class files -->
<target
name=
"clean"
depends=
"cleanGen"
>
<!-- delete all .class files recursively -->
<delete>
<fileset
dir=
"."
includes=
"**/*.class"
excludes=
"beaver/*.class"
/>
</delete>
</target>
<target
name=
"jar"
depends=
"build"
>
<jar
destfile=
"PrettyPrint.jar"
basedir=
"."
includes=
"**/*.class"
excludes=
"test/**"
>
<manifest>
<attribute
name=
"Main-Class"
value=
"JavaPrettyPrinter"
/>
</manifest>
</jar>
</target>
<!-- remove generated source files and their .class files -->
<target
name=
"cleanGen"
>
<delete
dir=
"${package}"
/>
</target>
</project>
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment