Skip to content
Snippets Groups Projects
Commit cc3a8612 authored by Anders Nilsson's avatar Anders Nilsson
Browse files

Just started writing code for generating a new compiler

parent b51432b5
No related branches found
No related tags found
No related merge requests found
/* -*-Java-*- */
import java.io.*;
aspect CompilerGeneration {
void ASTNode.genAbsGrammar(PrintStream pStream) {
for (int i=0; i<getNumChild(); i++) {
getChild(i).genAbsGrammar(pStream);
}
}
public void Start.genAbsGrammar(PrintStream p) {
super.genAbsGrammar(p);
}
void OwlClass.genAbsGrammar(PrintStream pStream) {
pStream.println(getAttribute(0).getValue().getSTRING_LITERAL());
}
}
aspect Name {
syn String Element
}
\ No newline at end of file
// package programs;
import AST.Start;
public class GenCompiler extends Parser {
public static void main(String args[]) {
Start ast = parse(args);
// Dump the AST
// ast.dumpTree(" ", System.out);
// Should be generated to a file when sufficiently
// implemented. AndersN 060210
ast.genAbsGrammar(System.out);
}
}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment