Skip to content

Commit

Permalink
Reset the build to a working state.
Browse files Browse the repository at this point in the history
Signed-off-by: Etienne M. Gagnon <egagnon@j-meg.com>
  • Loading branch information
egagnon committed Aug 8, 2012
1 parent 7766c59 commit 05c4206
Show file tree
Hide file tree
Showing 4 changed files with 61 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .classpath
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry excluding="org/sablecc/sablecc/codegeneration/|org/sablecc/sablecc/core/|org/sablecc/sablecc/core/transformation/|org/sablecc/sablecc/core/walker/|org/sablecc/sablecc/oldgrammar/|org/sablecc/sablecc/oldgrammar/transformation/|org/sablecc/sablecc/oldlrautomaton/" kind="src" path="src"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="output" path="classes"/>
</classpath>
2 changes: 1 addition & 1 deletion ant-files/build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ public class Version {
}
</echo>

<javac srcdir="${src.dir}" destdir="${classes.dir}" debug="true" />
<javac srcdir="${src.dir}" destdir="${classes.dir}" debug="true" excludes="org/sablecc/sablecc/codegeneration/**,org/sablecc/sablecc/core/**,org/sablecc/sablecc/oldgrammar/**,org/sablecc/sablecc/oldlrautomaton/**" />

<copy todir="${classes.dir}">
<fileset dir="${src.dir}">
Expand Down
24 changes: 18 additions & 6 deletions src/org/sablecc/sablecc/launcher/SableCC.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,12 @@
import java.util.*;

import org.sablecc.exception.*;
import org.sablecc.sablecc.codegeneration.*;
import org.sablecc.sablecc.core.*;
import org.sablecc.sablecc.exception.*;
import org.sablecc.sablecc.launcher.errormessage.*;
import org.sablecc.sablecc.semantics.*;
import org.sablecc.sablecc.syntax3.lexer.*;
import org.sablecc.sablecc.syntax3.lexer.Lexer;
import org.sablecc.sablecc.syntax3.node.*;
import org.sablecc.sablecc.syntax3.parser.*;
import org.sablecc.sablecc.syntax3.parser.Parser;
import org.sablecc.util.*;

/**
Expand Down Expand Up @@ -319,6 +316,11 @@ public static void compileFile(
br.close();
fr.close();

compileGrammar(sb.toString(), strictness, trace);

// TODO: implement

/*
Grammar grammar = compileGrammar(sb.toString(), strictness, trace);
if (generateCode) {
Expand All @@ -327,15 +329,19 @@ public static void compileFile(
destinationPackage, trace);
codeGenerator.run();
}
*/

trace.informativeln("Done!");
trace.informativeln();
trace.informativeln("SableCC has successfully compiled \""
+ grammarFile.toString() + "\".");
}
catch (IOException e) {
throw LauncherException.inputError(grammarFile.toString(), e);
}
}

public static Grammar compileGrammar(
// TODO: change return type and return structure
public static void compileGrammar(
final String text,
final Strictness strictness,
final Trace trace)
Expand All @@ -360,6 +366,11 @@ public static Grammar compileGrammar(

trace.verboseln(" Verifying semantics");

SemanticVerifier.verify(ast);

// TODO: implement

/*
Grammar grammar = new Grammar(ast);
trace.verboseln(" Compiling lexer");
Expand All @@ -373,5 +384,6 @@ public static Grammar compileGrammar(
}
return grammar;
*/
}
}
41 changes: 41 additions & 0 deletions src/org/sablecc/sablecc/semantics/SemanticVerifier.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
/* This file is part of SableCC ( http://sablecc.org ).
*
* See the NOTICE file distributed with this work for copyright information.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package org.sablecc.sablecc.semantics;

import org.sablecc.sablecc.syntax3.analysis.*;
import org.sablecc.sablecc.syntax3.node.*;

public class SemanticVerifier
extends DepthFirstAdapter {

public SemanticVerifier(
Start ast) {

// TODO: implement
}

// TODO: change return type and return structure
public static void verify(
Start ast) {

SemanticVerifier verifier = new SemanticVerifier(ast);
ast.apply(verifier);

// TODO: implement
}
}

0 comments on commit 05c4206

Please sign in to comment.