Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Anders Nilsson
OwlCompiler
Commits
28742f3a
Commit
28742f3a
authored
Jun 25, 2008
by
Anders Nilsson
Browse files
Having problems with top-level classes no longer explicitly declaring themselves on top level
parent
cd5ee26b
Changes
3
Hide whitespace changes
Inline
Side-by-side
DumpClasses.java
View file @
28742f3a
...
...
@@ -10,7 +10,7 @@ import AST.Start;
public
class
DumpClasses
extends
Parser
{
public
static
void
main
(
String
args
[])
{
Start
ast
=
parse
(
args
);
Start
ast
=
parse
(
args
[
0
]
);
// Dump the AST
// ast.dumpTree(" ", System.out);
...
...
GenCompiler.java
View file @
28742f3a
...
...
@@ -14,10 +14,14 @@ public class GenCompiler extends Parser {
public
static
void
main
(
String
args
[])
{
String
name
=
"default"
;
String
dirName
=
"default"
;
String
owlFile
=
""
;
int
i
=
0
;
while
(
i
<
args
.
length
)
{
if
(
args
[
i
].
equals
(
"-d"
))
{
dirName
=
args
[++
i
];
i
++;
}
else
if
(
args
[
i
].
equals
(
"-n"
))
{
name
=
args
[++
i
];
i
++;
}
else
{
...
...
@@ -27,7 +31,7 @@ public class GenCompiler extends Parser {
Start
ast
=
parse
(
owlFile
);
File
siarasDir
=
new
File
(
n
ame
);
File
siarasDir
=
new
File
(
dirN
ame
);
if
(!
siarasDir
.
isDirectory
())
{
siarasDir
.
mkdir
();
}
...
...
@@ -35,17 +39,17 @@ public class GenCompiler extends Parser {
String
fileName
=
null
;
try
{
// Generate JastAdd abstract grammar
fileName
=
n
ame
+
"/"
+
name
+
".ast"
;
fileName
=
dirN
ame
+
"/"
+
name
+
".ast"
;
PrintStream
pStream
=
new
PrintStream
(
new
File
(
fileName
));
ast
.
genAbsGrammar
(
pStream
);
// Generate Parser.java
fileName
=
n
ame
+
"/Parser.java"
;
fileName
=
dirN
ame
+
"/Parser.java"
;
pStream
=
new
PrintStream
(
new
File
(
fileName
));
ast
.
genParser
(
pStream
);
// Generate aspects
fileName
=
n
ame
+
"/GeneratedAspects.jrag"
;
fileName
=
dirN
ame
+
"/GeneratedAspects.jrag"
;
pStream
=
new
PrintStream
(
new
File
(
fileName
));
ast
.
genAspects
(
pStream
);
...
...
Types.jrag
View file @
28742f3a
...
...
@@ -31,6 +31,7 @@ aspect Types {
eq OwlClassUse.decl() {
ComplexElement top = getTopElement();
for (int i=0; i<top.getNumElement(); i++) {
// System.out.println(getId()+" == "+((ComplexElement) top.getElement(i)).getId());
if ((top.getElement(i) instanceof ComplexElement) &&
getId().equals(((ComplexElement) top.getElement(i)).getId())) {
return (OwlClassDecl) top.getElement(i);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment